The OrderReportJava demo

The OrderReportJava demo application provides an example of the Java files that can make up a report application, along with a variety of report design documents.

The OrderReport demo is the standard Genero Report Writer demo. Each language supported by Genero Report Writer provides its own version of this demo. For a general understanding of the demo functionality, see The OrderReport demo.

The OrderReportJava demo is the Java-specific version of the OrderReport demo. This topic covers details specific to this Java version of the demo.

The project

The project workspace is named OrderReportJava.4pw. You can access the project from the Tutorials & Samples tab, located on the Welcome Page.

The file is located at:
  • Windows: C:\Users\<username>\Documents\My Genero Report Writer Files\samples\Reports\OrderReportJava
  • Linux: /home/<user>/Genero Report Writer Files/samples/Reports/OrderReportJava

The Java files

These are the application source files:

OrderReportJava.java
This is the main Java source, containing the main function. Specifically, it:
  • Retrieves the data and outputs it to the Report Engine.
  • Displays a Swing dialog for input, allowing the user to select the desired report and the output settings.
  • Uses Reporting Runtime API functions to load the original settings from the form definition file (.4rp). Additional optional functions can specify the changes to be made to those settings, based on the user input.
  • Uses JAXB marshaling to run the report.
NanoHTTPD.java
To view Web reports, a Web server is required. To meet this requirement, we provide this single-file "mini Web server" for the viewing of Web reports in a demo environment. It handles HTTP requests from the Web Report Viewer.
OrderReportModel.java
The abstract class that describes the report data model.
OrderReportJDBCModel.java
One of the data sources of the report. The implementation of the report data model using JDBC with a MySQL officestore database.
OrderReportFileModel.java
One of the data sources of the report. The implementation of the report data model using the file OrderReport.unl
GenericReportDialog.java
If you select GenericList when running the OrderReportJava demo application, the displayed swing dialog contained in this file allows the end user to select which fields appear in the resulting report.
PivotTableDialog.java
If you select DynamicPivotTable when running the OrderReportJava demo application, the displayed dialog contained in this file allows the end user to select which fields appear as dimensions and measures in the resulting report.

The report design documents are common to all flavors of the OrderReport demos. See OrderReport demo reports.