create multiple report from a template

Hello All,
how can i fill a template more than once with different values on one document? Suppose I have a template Tmain and i run a SQL query to fill this template in order to get report1. Then I want to run the query on another table or other table records and fill the same template with new data to have report2. At the end I want to see a docx or xlsx report containing report1 and report2.

YARG does not support documents combination out of the box.
Technically, you can generate the reports and merge then programmatically using docx4j library, but I’m not sure how to do it better.
Also, you can have 2 different part in the same report, filled from different band.

If you provide more information about your requirements, we can try to find appropriate solution.

thanks a lot. here is more information about my requirements:
suppose i have a data base with these columns: id, fname,lname, address
for each id i want to have a separate report containing the values for these columns.

In the docx template you can organize it using tables linked with bands.
You can set one table cell to fill the whole page in docx, then you can put your aliases to the cell and YARG will make a cell (page) for each user.

For the xlsx you can use nested bands, but the result can only be in on sheet, so you can’t put each user to separate sheets.

1 Like