cancel
Showing results for 
Search instead for 
Did you mean: 

error in excel uploading

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

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.

Answers (2)

Answers (2)

monalisa_biswal
Contributor
0 Kudos

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.

Former Member
0 Kudos

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(); }