Crosstab (cross-tabulation) reports are reports containing tables that tabulate data across rows and columns. This feature was introduced in JasperReports 1.1. The following example illustrates the use of crosstab in a report. The JRXML template will generate a report displaying a table containing the number of aircraft in each city in the state of New York. The last column of the table will display the total number of aircraft for all models in the table in each city. The last row will display the total number of aircraft of each model in the table. To avoid having an unmanageable number of columns in the table, we will limit the report to aircraft models that start with the letter C
.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design// EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="CrossTabDemoReport" leftMargin="...