case CellType.STRING: case Cell.CELL_TYPE_NUMERIC: case Cell.CELL_TYPE_BLANK: not working and also tried CellType.STRING but no use still errors.
Asked
Active
Viewed 150 times
-1
-
case CellType.STRING: System.out.println(cell.getStringCellValue()); break; case Cell.CELL_TYPE_NUMERIC: System.out.println(cell.getNumericCellValue()); break; case Cell.CELL_TYPE_BLANK: System.out.println("--"); break; – Shaik Yousuf Baba Oct 04 '22 at 08:23
-
Copy entire class (with imports) and format code using " { } " option from the editor. With this, we can't do much. – JustQuest Oct 04 '22 at 08:32
-
Please do not put code as images. Paste it as formatted text (by editing your question). – DanielBarbarian Oct 04 '22 at 08:32
-
Also include information about what the actual error is. – DanielBarbarian Oct 04 '22 at 08:35
1 Answers
0
Try it with the following code:
switch (cell.getCellTypeEnum()) {
case STRING:
break;
case NUMERIC:
break;
case BLANK:
break;
default:
break;
}
getCellType is deprecated and shouldn´t be used anymore. See following post: Alternative to deprecated getCellType

juran.maurice
- 149
- 1
- 1
- 9