public static String getCellValueAsString(HSSFRow row,int column,boolean isDate){
HSSFCell cell = row.getCell(column, HSSFRow.CREATE_NULL_AS_BLANK);
int type = cell.getCellType();
String str = "";
if(type == HSSFCell.CELL_TYPE_FORMULA){
try {
str = String.valueOf(cell.getNumericCellValue());
} catch (IllegalStateException e) {
str = String.valueOf(cell.getRichStringCellValue());
}
}
str = str == null ? "" : str;
return str;
}
poi导入excel表格时遇到公式的单元格导入失败的解决方法
最新推荐文章于 2024-08-29 09:44:35 发布