518
edits
Changes
Version 6.0
==Summarising Report Data==__NOEDITSECTION__
In addition to displaying report details in an iReport template, the iReport Designer allows you create summaries or calculations of data returned in the report. These can take the form of totals, sums, and counts (stored in Variables), or more complicated data summaries such as Crosstabs or Charts. Because summarizing data necessarily depends on multiple records, data summaries must exist in bands ''after'' the Detail band such as the Summary band, Footer badband, or Group Footer bands.
===Adding a Footer or Summary Section to the Report===__NOEDITSECTION__
</ol>
{{note|It may be helpful to add a text label beside any counts that you add to the report to identify the value. To add a text label, drag the text field element [[Image:iRepText.png]] from the '''Palette''' pane. }}
===Displaying Totals===__NOEDITSECTION__
To create a custom variable:
# Follow the steps to [[Modify an iReport Template#Adding a Variable to an iReport Template| add a variable to an iReport]].
# From the '''Calculation Type''' list in the '''Properties''' pane, select the calculation that you would like to perform.
|-
| System || No calculation is made. Instead the last value is stored.
|-
| First || No calculation is made. Instead the first value is stored.
|}
</center>
==Crosstabs==__NOEDITSECTION__
In addition to summary variables, iReport provides the capability to build crosstab tables that display data in a grid for easy analysis and summary. Crosstabs allow you to choose data rows, columns, and the variable to be measured and then automatically produce a grid of results for display in a chart. As with other summary variables Crosstabs are generally used in the '''Summary Band''' in a report.
To create a Crosstab:
====Add a Pie Chart====__NOEDITSECTION__
To add a pie chart to the report:
#Create a report which groups the results by the attribute on which you would like to base your chart (e.g. ''status'').
#Ensure that the Summary Band is available on the iReport template canvas.
#[[Modify_an_iReport_Template#Adding a Variable to an iReport Template|Create a Variable]] to contain the values to be displayed in the chart (e.g. ''SUM_areaSize_byStatus''). This variable should be based on a numeric field (e.g. ''areaSize'') and should have the '''Reset type''' set to '''Group''' and the group selected set to the field you wish to create the chart from'' (e.g. ''status'').
# The next step is to provide the correct data for the chart to use. Pie Charts require a '''unique identifier''' and a '''numeric''' value where the unique identifier is the field to group the data by (i.e. the names of the wedges) and numeric value is the value to sum.
#:[[Image:iReport Charts3.png|center|500px|''Chart options'']]<div align="center">''Chart options''</div>
# To select the '''unique value''' choose the '''Expression editor''' button and '''choose the ''field'' the report is grouped by''' (e.g. ''status''). Note that charts in iReport will fail if the '''unique value''' is null. In order to account for null values, you will need to modify the expression so that null values are grouped into their own group. The expression should be modified to include the bolded text below. You should replace attribute with the name of the attribute that you selected in step b above.
#: '''$F{status} == null ? "N/A" : $F{status}'''
#:[[Image:iReport Charts5.png|center|500px|''Set Unique Value'']]<div align="center">''Set Unique Value''</div>
#Next, select the '''numeric value''' that contains the desired numeric data for the chart. '''Note: This should always be the variable created in step 3 above''' (e.g. ''SUM_status_byAreaSizeSUM_areaSize_byStatus'').
#:[[Image:iReport Charts6.png|center|500px|''Select the desired numeric variable'']]<div align="center">''Select the desired numeric variable''</div>
#Choose '''Next'''.
#: [[Image:IReport ChartData1.png|center|500px|''Chart Data Properties'']]<div align="center">''Chart Data Properties''</div>
# To edit the main properties of the chart, select the '''Details tab'''. Additionally, this screen can be used to edit the reset type of the chart which is relevant if the chart is displayed on a band other than the summary band.
# The '''Chart Details''' window displays.
#: [[Image:IReport ChartData2.png|center|500px|''Chart Data Properties'']]<div align="center">''Chart Data Properties''</div>
# In this window, the basic properties of the chart that were established in the Chart Wizard can be edited. These include: