Skip to content

Commit

Permalink
Merge pull request #1072 from siemens/fix/clearingreportdownload
Browse files Browse the repository at this point in the history
fix(clearingreport): Error while downloading clearing report

reviewed-by: [email protected]
tested-by: [email protected]
  • Loading branch information
JaideepPalit authored Dec 11, 2020
2 parents a6421a8 + c18b42b commit 64610e4
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.poi.xwpf.usermodel.*;
import org.apache.xmlbeans.XmlException;
import org.eclipse.sw360.datahandler.common.CommonUtils;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;

import java.math.BigInteger;
Expand Down Expand Up @@ -66,11 +67,15 @@ public static void addPageBreak(XWPFDocument document) {
}

public static void setText(XWPFRun run, String text) {
String[] split = text.split("\n");
run.setText(split[0]);
for (int i = 1; i < split.length; i++) {
run.addBreak();
run.setText(split[i]);
if (CommonUtils.isNullEmptyOrWhitespace(text)) {
run.setText("");
} else {
String[] split = text.split("\n");
run.setText(split[0]);
for (int i = 1; i < split.length; i++) {
run.addBreak();
run.setText(split[i]);
}
}
}

Expand Down

0 comments on commit 64610e4

Please sign in to comment.