Search code examples
javajasper-reports

Multiple JasperPrints in one JasperViewer


I have a report that is basically a form with multiple empty fields and a serial number generated by the program. Currently, the user can only get one of this by time, so I would like that the user could select the desired quantity of copies, and then, the JasperViewer showed all the copies in one window, instead of multiple windows as the number of copies. Thanks in advance.

**Apologize for bad English.


Solution

  • Well, you could have a list of JasperPrint objects and use an exporter to export them to one report. However, I'm not sure if you could then use the JasperViewer to view them.

    Each JasperPrint object does have a collection of pages though. So, you could take the first JasperPrint object and append the pages from the other reports, using the addPage() method.