Creating a JRXML Report Template
The first step when creating a report is to create a JRXML template. As mentioned in Chapter 1, JasperReports JRXML templates are standard XML files. However, by convention, they have an extension of .jrxml
, and are referred to as JRXML files or JRXML templates. All JRXML files contain a<jasperReport>
root element that can contain many sub-elements. All of these sub-elements are optional. Since our goal for this chapter is to get a feel of how to design a report, we will obviate most of the<jasperReport>
sub-elements. We will use only one sub-element, namely the<detail>
sub-element.
Our first report will display a static String. Its JRXML follows:
<?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="FirstReport"> <detail> <band height="20"...