I have a way of dealing with the "replacement" issue. I have tried serveral
days, but cannot finish the task. (a similar task as the OP had). 
So my approach is create an empty List<IBodyElement> 
so now you read in your templates, according to the templates, construct
paragraphs and tables, and then stuff them into the list with order. 
and then you can use a for loop:
XWPFDocument newDoc = new XWPFDocument();
for(IBodyElement element : list){
if(element.getElementType().equals("PARAGRAPH"){
XWPFParagraph pr = newDoc.createParagraph();
newDoc.setParagraph((XWPFParagraph) element, newDoc.getPosOfParagrah(pr));
}
}
and add your if condition to table.......by doing the same.....

this will do the trick~ i've proven it work. 

but this has a serious problem: if there is a picture in the original
document, it will show as a "broken linked picture" like what you see on
website, and tells you the picture currently cannot be showed. 


--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Replacing-placeholder-to-a-Table-tp3392424p5709992.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to