319
edits
Changes
→Displaying Totals
===Displaying Totals===
iReport allows you to display the total of a particular attribute in the report. This is done by creating a variable to store the total value (see [[Modify an iReport Template#Adding a Variable to an iReport Template| Adding a Variable to an iReport]]).
To display a total:
</center>
<ol start="63">
<li>From the Reset Type list, select when a variable value should be reset to the initial value. For example, suppose you wanted to count the number of accidents in each location. Each time a new group—in this case a location—is encountered, the variable should be reset. To do this, you would need to reset the value of the variable after each group.</li>
</ol>
</center>
<ol start="74">
<li>If you select ''Group'' as the '''Reset Type''', you will need to select the group on which you would like to reset the variable from the '''Reset Group''' list. The '''Reset Group''' list will contain all fields on which the report is grouped.</li>
</ol>
{{note|If the field on which the variable should be reset is not listed in the Reset Group list, be sure that the field is included as one of the grouping levels for the report.}}
<ol start="85">
<li>The '''Variable Expression''' field specifies the expression that will be provided to the variable. Typically, this will be the value of a field in the report. To specify a field in the report:</li>
<ol type="a">
<li>Click Edit the [[Image:iRepEditor.png]] button that is displayed beside the '''Variable Expression''' field.</li>
:The Expression editor window displays.
<li>From the Objects and expressions tab, select '''Fields''' from the left pane.</li>