Java Reference
In-Depth Information
Valid Values
Default Value
Determines when
the value of a
variable is reset.
Column : The variable value
is reset at the beginning of
each column.
Group : The variable value
is reset when the
group specified by
incrementGroup changes.
None : The variable value is
never reset.
Page : The variable value is
recalculated at the beginning
of every page.
Report : The variable value
is recalculated once, at the
beginning of the report.
Determines the
name of the
group at which
the variable value
is reset, when
is Group .
The name of any group
declared in the JRXML report
As can be inferred from the table, JasperReports variables can be used not only to
simplify report expressions, but also to perform calculations, and to display the
result of those calculations on the report.
Let us modify the report we developed in the previous section so that it displays the
total number of aircraft in each state. To accomplish this, we need to create a report
variable and set its calculation attribute to Count . The following JRXML template
illustrates this concept:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
<jasperReport name="VariableCalculationDemo">
<![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 = 'US' and state like 'A%'
Search WWH ::

Custom Search