这个是我在导入excel表时,一个cell读取数据时报的错误,当时就在想为什么会报错,因为我读进去用的是row.getcell(i).getStringcellValue(),后来才发现因为表格里全是数字,POI默认为int类型,所以要再你要读取的cell前面设置一下,row.getCell(i).setCellType(Cell.CELL_TYPE_STRING);
这样都读出来就没问题了。
java.lang.IllegalStateException: Cannot get a text value from a numeric cell
最新推荐文章于 2023-05-03 16:43:40 发布