0

Is there are Template Engine for Java that can build docx/odt reports from docx/odt templates? I've already tried xdocreport but there are only row- and cell-based blocks but I need whole-table-block. Is there are something for Java like tinybutstrong for PHP?

Sumit Singh
  • 15,743
  • 6
  • 59
  • 89

1 Answers1

0

What do you mean with whole-table-block? If you wish loop for table-cols with XDocReport it's possible with advanced table by using @before-cell and @after-cell. See DocxTableWithoutFieldsMetadataWithVelocity sample (java and docx).

The docx contains that :


«@before-row#foreach($d in $developers)»«$d.Name»

«@after-row#end»

«@before-cell#foreach($r in $d.Roles)»«$r.Name»«@after-cell#end»


which loops for each developpers (to generate row) and for each row it loops for each cells (dynamic columns) to generate a row per role of developers.

This syntax is a little complex, but you can manage dynamic columns.

Angelo
  • 2,027
  • 13
  • 17