Skip to content

Commit 8951b78

Browse files
fix: check for formula cell type
1 parent 03a8371 commit 8951b78

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

backend/src/main/java/org/eclipse/tractusx/puris/backend/file/logic/service/ExcelService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ private DataImportResult extractAndSaveDeliveries(Sheet sheet) {
470470
}
471471
deliveries.add(delivery);
472472
} catch (Exception e) {
473-
errors.add(new DataImportError(rowIndex, List.of(e.getMessage() + " Further validations for this row are not possible.")));
473+
errors.add(new DataImportError(rowIndex, List.of(e.getMessage() + " Further validations for this row are not possible.", row.toString())));
474474
}
475475
}
476476

@@ -690,7 +690,7 @@ private List<String> extractHeader(Sheet sheet) {
690690
}
691691

692692
private String getStringCellValue(Cell cell) {
693-
return cell == null || cell.getCellType() == CellType.BLANK ? null : cell.getCellType() == CellType.STRING
693+
return cell == null || cell.getCellType() == CellType.BLANK ? null : (cell.getCellType() == CellType.STRING || cell.getCellType() == CellType.FORMULA)
694694
? cell.getStringCellValue().trim()
695695
: String.valueOf(cell.getNumericCellValue()).trim();
696696
}

docs/user/User_Guide.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ An Admin can upload data in this page. Once the file is uploaded, all existing d
264264

265265
Right now, only files of type xlsx are supported.
266266

267+
### Formula support
268+
269+
The import feature evaluates formulas to dynamically calculate values. Due to technical limitations of the underlying Java library Apache POI not all functions are supported. You can find a list of supported functions int the [Apache POI documentation](https://poi.apache.org/components/spreadsheet/eval-devguide.html#appendixA).
270+
267271
### Import view
268272

269273
![Overview of the Import view](img/import_view.png)

0 commit comments

Comments
 (0)