on 11-28-2006 3:27 AM
Hi All,
i am accessing an excel file which has date in one of its filed in the format "DD/MM/YYYY" and this field is taken as numeric field when i execute the following code
if (cell13.getCellType() == cell13.CELL_TYPE_NUMERIC)
{
Cellvalue = String.valueOf(cell13.getNumericCellValue());
}
String temp = Cellvalue.substring(6,10) + "-" + Cellvalue.substring(3,5) + "-" + Cellvalue.substring(0,2);
java.sql.Date issuedt = java.sql.Date.valueOf(temp) ;
user_details.setPRJ_EN_DATE(issuedt);
the value in the variable "Cellvalue" is some integeral value coz of which substring function gives an error.
Hi Alka,
<a href="http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFCell.html#getNumericCellValue()">getNumericCellValue()</a> returns double. So, you can not assume that
String.valueOf(cell13.getNumericCellValue());
would return "DD/MM/YYYY" and you can not parse it in this way.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After setting table's selection property to none still it appears clickable because u have set onLeadSelect of this table to the 'Details' action.Dont bind any action to onLeadSelect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alka
check whether in which format the data was comming from cell.
or
Take the field as Date and use the following
if(cell1.getType()==CellType.Date)
{ DateCell dc=(DateCell) cell1;
datecell1=dc.getDate(); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.