Output a report in multiple formats (GRW for Java)

You want to apply the same data set in different output formats or across multiple report designs. Use an intermediary XML file to ensure that the same data is used for each report while also avoiding the overhead of multiple database access.

The Genero Report Engine expects an XML data stream for each report it creates. Data often changes rapidly, and if you make multiple calls to the same database, you risk having different data for each call. In addition, retrieving data from a database can be an expensive operation.

When creating multiple reports from the same data set, we recommend that you create an intermediate XML file of the data set, then use that data file as the input for each of the reports. With this approach, you only read from the database one time, yet you end up with the same data in each report.

  1. In your Java code, set up and configure your output to XML. See Output as XML (Java).
  2. Feed the XML report data into new reports, using the runFromXML method. See Feeding the report data from an XML file.