or data can be grouped into logical sections. Say, we are creating a report about cars.
JasperReports allows us to group the data by make, model, year, or a combination
of these or any other piece of data displayed on the report. Data grouping allows us
to better control the layout of the report. Data-group definitions can also be used to
calculate subtotal values based on a subset of the report data. Groups are also used
to define datasets for charts and graphs. Data grouping is discussed in detail in
Multiple Ways to Present Data
JasperReports provides the ability to display report data textually or graphically via
charts. JasperReports allows us to use report expressions to generate reports that
display dynamic data. That is, data that is not directly passed to the report or stored
anywhere, but is calculated from the data contained in the datasource and/or
Multiple Ways to Supply Data
JasperReports allows developers to pass data to a report by passing it report
parameters. Report parameters can be instances of any Java class.
Data can also be passed to a report by using special classes called datasources.
Report parameters and datasources can be combined for maximum flexibility.
JasperReports can generate reports using any relational database system supported
by JDBC. However, it is not limited to database reports only. It can generate reports
from a number of datasources, including XML files, Plain Old Java Objects (POJOs) ,
any class implementing the java.util.Map interface, and any class implementing
the javax.swing.TableModel interface.
JasperReports also supports empty datasources, which are used for simple
reports that have no dynamic data displayed. If we need to create a report from a
datasource, not directly supported by JasperReports, it allows us to create our own
custom datasources. JDBC datasources are discussed in detail in Chapter 4. Other
datasource types, including custom datasources, are discussed in detail in Chapter 5.
JasperReports is capable of generating background images or text on the reports it
generates. These background images can serve as a sort of 'watermark' for the report.
A watermark is like a secondary image that is laid over the primary image.