Page 1 of 1

complete a table automatically

PostPosted: Thu Mar 13, 2014 7:27 pm
by Black017
i create my tabel with MSWord witch compose on 2 rows ( header and content). i put in the content of row ${deadate} but this deadate return a list in my programme java so how can i populate automatically my table when i generate docx_OUT using Doxc4j and mappings.put("deadate", myListe in Java);

Thanks

Re: complete a table automatically

PostPosted: Thu Mar 13, 2014 8:35 pm
by jason
You can wrap the table row in a content control and bind it as a "repeat" to an XML representation of your list. See the subforum and opendope.org for more. That's the approach docx4j takes.

See https://github.com/plutext/docx4j/blob/ ... ndler.java line 929 for how it is done. You may glean some hints from that as to how to roll your own convert a list to table rows, but it will be of limited help since it is tied so tightly to content controls and data binding.