From 1c1e26ec89c57ff6cdf7978cdabfb8dfc8c136f5 Mon Sep 17 00:00:00 2001 From: aoezyetimoglu Date: Tue, 9 Nov 2021 20:17:45 +0100 Subject: [PATCH] RED-2641 Fixed Columns-Header in A1-Report shifted to the right --- .../v1/server/service/WordReportGenerationService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/WordReportGenerationService.java b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/WordReportGenerationService.java index 9875fa7..098bd69 100644 --- a/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/WordReportGenerationService.java +++ b/redaction-report-service-v1/redaction-report-service-server-v1/src/main/java/com/iqser/red/service/redaction/report/v1/server/service/WordReportGenerationService.java @@ -292,6 +292,8 @@ public class WordReportGenerationService { if (containsRedactionPlaceholder(cell.getText())) { placeholderCellPos.put(i, cell.getText()); placeholderRow = j; + } else if (cell.getText().isEmpty()) { + placeholderCellPos.put(i, ""); } } } @@ -300,7 +302,11 @@ public class WordReportGenerationService { reportEntries.forEach(entry -> { XWPFTableRow row = table.createRow(); for (Map.Entry entry1 : placeholderCellPos.entrySet()) { - setText(row.getCell(entry1.getKey()), replaceTextPlaceholderWithEntries(entry, filename, entry1.getValue())); + if(!entry1.getValue().isEmpty()) { + setText(row.getCell(entry1.getKey()), replaceTextPlaceholderWithEntries(entry, filename, entry1.getValue())); + } else { + setText(row.getCell(entry1.getKey()), ""); + } } }); }