i am using the attached template to generate a docx document.
First of all i am replacing the value in side "{}" withreal value.
The second step is the replacement of value inside a Table.
The problem is that i cant detect paragraph when in a Table is.
This tutorial helped me a lot.
http://www.smartjava.org/content/create-complex-word-docx-documents-programatically-docx4j
I can now replace value wi this method :
- Code: Select all
MainDocumentPart documentPart = template.getMainDocumentPart();
HashMap<String, String> mappings = new HashMap<>();
mappings.put("artnum", "101010");
mappings.put("bezeichung", "ok es geht");
mappings.put("farben", "rot blue");
mappings.put("gros", "L, M ,XL");
VariablePrepare.prepare(template);
When i try to replace value on a paragraph within a table it wont work.
There is a nested table that i was able to add rows in it. But when i try to add rows with different values on the Global Table it just copy the last values.
Can anyone help !