diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ScmReportService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ScmReportService.java index 232e408..813e490 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ScmReportService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/ScmReportService.java @@ -42,6 +42,12 @@ public class ScmReportService { var firstRow = sheet.getRow(0); + int firstRowIndex = 1; + while (firstRow == null) { + firstRow = sheet.getRow(firstRowIndex); + firstRowIndex++; + } + int fileColumnIndex = 0; int textColumnIndex = firstRow.getLastCellNum() - 1; int valueIndexColumn = firstRow.getLastCellNum() - 2; @@ -55,6 +61,8 @@ public class ScmReportService { Map componentIndexMap = new HashMap<>(); + Row finalFirstRow = firstRow; + componentLog.getComponentLogEntries().forEach(componentLogEntry -> { if (componentLogEntry.getComponentValues().isEmpty()) { @@ -71,7 +79,7 @@ public class ScmReportService { CellUtil.setVerticalAlignment(fileNameCell, VerticalAlignment.TOP); // Component, file attributes and index cell - addOtherCells(sheet, excelModel, rowIndex, componentIndexMap, componentLogEntry, row, fileModel, firstRow, componentColumnIndex, textColumnIndex, valueIndexColumn); + addOtherCells(sheet, excelModel, rowIndex, componentIndexMap, componentLogEntry, row, fileModel, finalFirstRow, componentColumnIndex, textColumnIndex, valueIndexColumn); });