Fixes bug on DMP and Dataset docx export, removing the upper empty element.
This commit is contained in:
parent
1911670ea3
commit
e0c5e4a955
|
@ -272,6 +272,14 @@ public class DataManagementPlanManager {
|
|||
// Page break at the end of the Dataset.
|
||||
XWPFParagraph parBreakDataset = document.createParagraph();
|
||||
});
|
||||
|
||||
// Removes the top empty headings.
|
||||
document.removeBodyElement(0);
|
||||
document.removeBodyElement(0);
|
||||
document.removeBodyElement(0);
|
||||
document.removeBodyElement(0);
|
||||
document.removeBodyElement(0);
|
||||
|
||||
String fileName = dmpEntity.getLabel();
|
||||
fileName = fileName.replaceAll("[^a-zA-Z0-9+ ]", "");
|
||||
File exportFile = new File(fileName + ".docx");
|
||||
|
|
|
@ -263,6 +263,14 @@ public class DatasetManager {
|
|||
wordBuilder.build(document, pagedDatasetProfile, visibilityRuleService);
|
||||
String label = datasetEntity.getLabel().replaceAll("[^a-zA-Z0-9+ ]", "");
|
||||
File exportFile = new File(label + ".docx");
|
||||
|
||||
// Removes the top empty headings.
|
||||
document.removeBodyElement(0);
|
||||
document.removeBodyElement(0);
|
||||
document.removeBodyElement(0);
|
||||
document.removeBodyElement(0);
|
||||
document.removeBodyElement(0);
|
||||
|
||||
FileOutputStream out = new FileOutputStream(exportFile);
|
||||
document.write(out);
|
||||
out.close();
|
||||
|
|
Loading…
Reference in New Issue