diff --git a/core/src/main/java/datart/core/common/POIUtils.java b/core/src/main/java/datart/core/common/POIUtils.java index 25a17187b..06fba9e19 100644 --- a/core/src/main/java/datart/core/common/POIUtils.java +++ b/core/src/main/java/datart/core/common/POIUtils.java @@ -180,11 +180,20 @@ public static List> loadExcel(String path) throws IOException { Exceptions.msg("empty excel :" + path); } int columns = row0.getPhysicalNumberOfCells(); + int rowId = 0; while (rowIterator.hasNext()) { Row row = rowIterator.next(); + rowId += 1; LinkedList cellValues = new LinkedList<>(); - for (int i = 0; i < columns; i++) - cellValues.add(readCellValue(row.getCell(i))); + for (int i = 0; i < columns; i++) { + try { + cellValues.add(readCellValue(row.getCell(i))); + } catch (Exception e) { + Exceptions.msg("read cell value error, row: " + String.valueOf(rowId) + + ", column: " + String.valueOf(i) + ". errmsg: " + e.toString() + ); + } + } rows.add(cellValues); } }