EGL can produce reports based on the JasperReports
open-source, Java-based reporting library. For details on that library, see
the following Web site:
http://jasperreports.sourceforge.net
EGL does not provide a mechanism for report layout. You must do this:
- Import a JasperReports design file (extension jasper); or
- Use a text editor or specialized tool to create a JasperReports XML source
file (extension jrxml). The EGL runtime compiles that source into a
.jasper design file automatically; for details on this process, see Creating
the report design file.
Here are two specialized tools for creating
a design file:
The EGL report driver (which you write to drive report production) identifies
the JasperReports design file (extension
jasper) and relies on that
design file for a number of formatting definitions:
- The design file defines fonts, headers, footers, the fields to appear
in the report, positions of those fields, subtotals from those fields, and
other basic components of the report.
- If you use a database connection as the source of the report, the design
file will probably contain your SQL query.
- The design file can create nested subreports to provide additional data
for each line item in the report. See Creating Subreports.
At run time, your EGL report driver sets up basic parameters, then hands
control to the JasperReports engine. The JasperReports engine creates an intermediate
file called the destination file (extension jrprint) and fills this
file with report data. Based on the specifications in your driver file, the
JasperReports engine then formats the report data for one or more exported
files. Exported file formats can be .pdf, .html, .xml, .txt, and/or .csv.
If you also code an EGL handler of type JasperReport, the finished report
can reflect events that occurred as your EGL report driver filled the report
with data. For example, you can produce dynamic report content by comparing
report subtotals with outside information like commission structures or insurance
reimbursements.
When you write EGL code that interacts with a report, you do these things:
- Create variables that are based on the predefined parts Report and ReportData.
- Interact with the design file by invoking functions from the system library
ReportLib, using those variables as arguments in the function invocations