A JFreeReport instance is used as report template to define the visual layout of a report and to collect all data sources for the reporting. Possible data sources are the {@link TableModel}, {@link Expression}s or {@link ReportParameterValues}. The report is made up of 'bands', which are used repeatedly as necessary to generate small sections of the report.
Accessing the bands and the elements:
The different bands can be accessed using the main report definition (this class):
- the report header and footer can be reached by using
getReportHeader()
and getReportFooter()
- the page header and page footer can be reached by using
getPageHeader()
and getPageFooter()
- the item band is reachable with
getItemBand()
- the no-data band is reachable with
getNoDataBand()
- the watermark band is reachable with
getWaterMark()
Groups can be queried using
getGroup(int groupLevel)
. The group header and footer are accessible through the group object, so use
getGroup(int groupLevel).getGroupHeader() and getGroup(int groupLevel).getGroupFooter(). All report elements share the same stylesheet collection. Report elements cannot be shared between two different report instances. Adding a report element to one band will remove it from the other one. For dynamic computation of content you can add {@link Expression}s and {@link org.pentaho.reporting.engine.classic.core.function.Function}s to the report. Creating a new instance of JFreeReport seems to lock down the JDK on some Windows Systems, where no printer driver is installed. To prevent that behaviour on these systems, you can set the {@link Configuration} key"org.pentaho.reporting.engine.classic.core.NoPrinterAvailable" to "false" and JFreeReport will use a hardcoded default page format instead. A JFreeReport object always acts as Master-Report. The JFreeReport object defines the global report-configuration, the report's datasource (through the DataFactory property) and the ResourceBundleFactory (for localization).
@author David Gilbert
@author Thomas Morgner