在使用POI进行导入数据时,出现如下错误:
Cannot get a text value from a numeric cell
原因:我们试图从一个数字格式的CELL中读取字符串
解决办法:设置单元格格式
HSSFCell cell = row.getCell(keyIndex);
cell.setCellType(HSSFCell.CELL_TYPE_STRING);
在使用POI进行导入数据时,出现如下错误:
Cannot get a text value from a numeric cell
原因:我们试图从一个数字格式的CELL中读取字符串
解决办法:设置单元格格式
HSSFCell cell = row.getCell(keyIndex);
cell.setCellType(HSSFCell.CELL_TYPE_STRING);