https://bz.apache.org/bugzilla/show_bug.cgi?id=57618
Bug ID: 57618
Summary: How to set heading style for a paragraph in a docx
file using Apache POI ?
Product: POI
Version: 3.9-FINAL
Hardware: PC
Status: NEW
Severity: critical
Priority: P2
Component: XWPF
Assignee: [email protected]
Reporter: [email protected]
I am trying to create a docx file with poi but I cannot set heading style for a
paragraph. My code structure is like below;
XWPFDocument document= new XWPFDocument();
//Write the Document in file system
FileOutputStream out = new FileOutputStream(new
File("C:/Users/2/Desktop/RequirementModelDocument.docx"));
XWPFParagraph paragraph = document.createParagraph();
XWPFRun run=paragraph.createRun();
paragraph.setAlignment(ParagraphAlignment.LEFT);
paragraph.setStyle("Heading1"); // not working
run.setText(reqLevel.getName());
run.setBold(true);
run.setFontFamily("Calibri Light (Headings)");
Its like ignores the paragraph.setStyle("Heading1"); line. I've looked at the
apache's examples but I could not see any.
regards
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]