破文档导入设置单元格式也不行,找了半天发现是代码有点老
private String getCellValue(Row row, int idx)
{
return row.getCell(idx) == null ? "" : row.getCell(idx).getStringCellValue();
}
//看了下 直接转String是有问题的 要转换
private String getCellValue(Row row, int idx)
{
return row.getCell(idx) == null ? "" : new DataFormatter().formatCellValue(row.getCell(idx));
}
//使用的话 这样就不会报错了
Row row = sheet.getRow(i);
getCellValue(row,sum++);