Currently i am using String data= sheet1.getRow(row).getCell(column).getStringCellValue();
It works properly for String value but displays error for numeric value.
So i have to add numeric value like "34567" in excel.
Is there any other method to fetch both numeric and String ?
2 Answers
You will get an error when you try to fetch the numeric cell as String.
You should be setting the cellType as string like below, before fetching the numeric cell.
HSSFCell yourCell = sheet1.getRow(row).getCell(column);
yourCell.setCellType(Cell.CELL_TYPE_STRING);
String data = yourCell.getStringCellValue();
1 Comment
mahendra sonavane
Thanks a lot vijay .. it works for me .. :) Appreciate your knowledge :) @vijay