One nice feature of JasperReports is that it allows incorporating a report within another report, that is, one report can be a subreport of another. Subreports allow us to keep report designs simple, since we can create many simple reports and encapsulate them into a master report.
Let us create a more detailed version of the report discussed in the previous section. This new version divides the report on the number of aircraft in the city they are registered to. We will create one report that displays the aircraft registered in each city for a particular state, and use that report as a subreport for a master report that divides the aircraft by state. The JRXML template for the subreport is as follows:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="AircraftCityReport">...