poi 读取excel 文件,当excel 有函数时,poi直接读取返回的是excel 函数,并不能返回函数计算结果:
解决步骤:
sheet.setForceFormulaRecalculation(true);
判断该列格式是否为函数,为函数直接getNumericCellValue()可获取计算结果
Cell cell = row.getCell(gCellName);
if(cell.getCellType()==CellType.FORMULA){
double result = cell1.getNumericCellValue();
}
如果excel 数据量小时 excel 读取时间不影响,数据量大时,读取excel 时间会有些长。