Hello, how can I create a table in the footer? For text I find this: CTP ctp = CTP.Factory.newInstance(); CTR ctr = ctp.addNewR(); CTRPr rpr = ctr.addNewRPr(); CTText textt = ctr.addNewT(); textt.setStringValue(" - Page 1 - "); XWPFParagraph codePara = new XWPFParagraph(ctp, document); XWPFParagraph[] newparagraphs = new XWPFParagraph[1]; newparagraphs[0] = codePara; CTSectPr sectPr = document.getDocument().getBody().addNewSectPr(); XWPFHeaderFooterPolicy headerFooterPolicy = new XWPFHeaderFooterPolicy(document, sectPr); headerFooterPolicy.createFooter(STHdrFtr.DEFAULT, newparagraphs); Version: poi-3.12-beta1 Thanks
Fixed by r1767175. This contains a breaking change. Creating a new header of footer no longer defaults to adding an empty paragraph when no paragraphs are provided. This facilitates adding a Table as the first block element of the header or footer. If no block elements are added to the header or footer, then an empty paragraph will be added automatically when the document is saved to prevent writing a corrupt document.
Created attachment 34411 [details] mylyn/context/zip