在使用POI操作excel时,出现异常 Cannot get a text value from a numeric cell
1、原因是
该行代码
question.setTitle(row.getCell(1).getStringCellValue());
读取一个字符串正常
当内容是一个数字类型时产生异常
2、解决方法
row.getCell(1).setCellType(Cell.CELL_TYPE_STRING); // 设置cell类型为String,纯数字也可读