Java Reference
In-Depth Information
only when it is different from the previous one. This will improve report readability,
since the person reading the report would not have to look at the model number
unless it is different from the previous one. In the following example, we will modify
the JRXML template discussed in that section to accomplish this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="IsPrintRepeatedValuesDemo">
<queryString>
<![CDATA[select a.tail_num, a.aircraft_serial, am.model, a.state
from aircraft a, aircraft_models am
where a.aircraft_model_code = am.aircraft_model_code
and a.country = 'US' and state like 'A%'
order by state, model]]>
</queryString>
<field name="tail_num" class="java.lang.String"/>
<field name="aircraft_serial" class="java.lang.String"/>
<field name="model" class="java.lang.String"/>
<field name="state" class="java.lang.String"/>
<group name="StateGroup">
<groupExpression>
<![CDATA[$F{state}]]>
</groupExpression>
<groupHeader>
<band height="40">
<staticText>
<reportElement x="0" y="10" width="115" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<text>Aircraft Registered In:</text>
</staticText>
<textField>
<reportElement x="116" y="10" width="20" height="20"/>
<textFieldExpression>$F{state}</textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
 
Search WWH ::




Custom Search