在使用公式格式解析列中值的 excel 文件時(shí),我收到 null。這是我的代碼: Cell cell = row.getCell(i); CellValue cellValue = evaluator.evaluate(cell); switch(cell.getCellType()) { case Cell.CELL_TYPE_NUMERIC: returnedMap.put(arrayForMappingNames[index], ""+cell.getNumericCellValue()); break; case Cell.CELL_TYPE_STRING: returnedMap.put(arrayForMappingNames[index], cell.getStringCellValue()); break; case Cell.CELL_TYPE_FORMULA : returnedMap.put(arrayForMappingNames[index], cellValue.getStringValue()); break; default : returnedMap.put(arrayForMappingNames[index], ExcellUtil.DEFAULT_VALUE); }
1 回答

蕪湖不蕪
TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超7個(gè)贊
Cell cell = row.getCell(i);
CellValue cellValue = evaluator.evaluate(cell);
String columnValue = formatter.formatCellValue(cell, evaluator);
returnedMap.put(arrayForMappingNames[index], columnValue);
添加回答
舉報(bào)
0/150
提交
取消