RED-9925 - Remove extra breakline from report

This commit is contained in:
Andrei Isvoran 2024-09-20 14:15:40 +03:00
parent d03815a7a1
commit bf6627ed5d

View File

@ -587,7 +587,9 @@ public class WordReportGenerationService {
private int setText(XWPFTableCell cell, String value) {
// Apache POI automatically adds an initial empty paragraph to a cell resulting in a break line.
cell.removeParagraph(0);
if (cell.getParagraphs() != null && !cell.getParagraphs().isEmpty()) {
cell.removeParagraph(0);
}
cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER);
XWPFParagraph addParagraph = cell.addParagraph();
XWPFRun run = addParagraph.createRun();