Changes

Jump to: navigation, search

Summarize iReport Template Data

3,641 bytes added, 14:04, 13 November 2015
no edit summary
__FORCETOC__
{{TOC right}}
{{HowTo's
|[[Start and Configure i-Report|Start and Configure i-Report]]
|[[Create a Basic i-Report Template|Create a Basic i-Report Template]]
|[[Modify an iReport Template|Modify an iReport Template]]
|[[Format an iReport Template|Format an iReport Template]]
|[[Create i-Report Templates with Subreports|Create i-Report Templates with Subreports]]
|[[Summarize i-Report Template Data|Summarize i-Report Template Data]]
}}
==Summarizing Summarising Report Data==__NOEDITSECTION__In addition to displaying report details in an iReport template, the iReport Designer allows you create creating summaries or calculations of data returned in the report. These can take the form of totals, sums, and counts (stored in Variablesvariables), or more complicated data summaries such as Crosstabs crosstabs or Chartscharts. 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>
[[Image:iRep22.png|center|500px|''Figure 22. REPORT_COUNT element in summary section'']]
<div align="center">
''Figure 22. REPORT_COUNT element in summary section''
</div>
</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 static 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>
{| class="wikitable" width="600"
|-
| align="center" colspan="2" | '''Table 5. Reset Types'''
|-
| width="150pt" | '''Reset Type'''
|}
==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:
# Select the '''Field''' or '''Variable''' to use to represent the data in the grid. Typically this is a numeric field (e.g. areaSize) or if a count of the records is desired, the ''REPORT_COUNT'' variable.
#: [[Image:IReport Crosstab4.png|center|500px|''Crosstab wizard'']]<div align="center">''Crosstab wizard''</div>
# Finalize Finalise the Crosstab display.
#: [[Image:IReport Crosstab5.png|center|500px|''Crosstab wizard'']]<div align="center">''Crosstab wizard''</div>
# The Crosstab displays.
[[Image:IReport Crosstab7.png|center|500px|''Crosstab Preview'']]<div align="center">''Example Crosstab Preview''</div>
==Charts==__NOEDITSECTION__
Charts provide a visual representation of the report data. Before you add a chart to your report, you should ensure that your report contains the following:
#At least one variable that contains a calculation. This calculation may be a count, total, or other custom calculation. These calculated variables define the size of the chart segment. The '''Reset type''' of this calculation should be set to '''Group''' and use the report grouping defined in #1. See [[Modify_an_iReport_Template|Modify an iReport Template]] for more information on [[Modify_an_iReport_Template#To_add_a_variable_manually|adding variables]].
===Pie Chart===__NOEDITSECTION__
====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'''.
# The report can now be previewed to ensure it is functioning as expected.
#:[[Image:iReport ChartsPreview.png|center|500px|''Preview with Chart'']]<div align="center">''Preview with chart''</div>
====Modify a Pie Chart====__NOEDITSECTION__Once a chart has been created in iReport Designer, its properties can be edited by selecting the '''Chart Data''' option on the right click menu and adjusting the values and properties.  To modify a pie chart:# Right click on the chart in iReport Designer and select '''Chart Data''' from the menu.# The Chart details window displays.#: [[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:#* '''Key Expression''': the field used to group data for charting purposes. To change the field, simply select another field. '''Note:''' The field must be used in the creation of the variable used in the value expression or the results will be incorrect.#* '''Value Expression''': the variable used to store the data to be displayed in the chart. If changes are made this value it is recommended to edit the variable properties as well.#* '''Label Expression''': the area used to define the labels for the chart. Any valid expression can be used here. See [[Summarize iReport Template Data#Variable Expressions|Variable Expressions]] for more details.
 ===Bar Charts===__NOEDITSECTION__
Bar charts, unlike Pie Charts, have a third variable option that can be included in the report. In addition to the category and value expressions, bar charts add the option of a '''''series'''''. The series choice adds an additional possibility of grouping data though is not required.
====Add a Bar Chart====__NOEDITSECTION__
To add a bar 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'')
#Select the '''Chart''' option from the '''Palette''' pane and drag it to the '''Summary Band''' of the report template to start the '''Chart Wizard'''.
#Select one of the bar chart options.
#:[[Image:iReport Charts1IReport BarChart.png|center|500px|''Chart options'']]<div align="center">''Chart options''</div>
#Choose Main report dataset.
#:[[Image:IReport BarChart_Step1.png|center|500px|''Chart options'']]<div align="center">''Chart options''</div>
# Provide a '''Series Expression''' (''optional'').
#:[[Image:iReport Chart Bar1.png|center|500px|''Series Expression'']]<div align="center">''Series Expression''</div>
#: The expression that you enter in the Series Expression field will vary based on how you want the horizontal axis to appear:
#*If you would like the horizontal axis of the bar chart to reflect a single attribute such as the chart displayed below, the Series Expression will be the same as the Category expression.
#:[[Image:iRep30.png|center|500px|''Figure 30. Bar chart –Single attribute y-axis'']]<div align="center">''Figure 30. Bar chart –Single attribute y-axis''</div>
#*If you would like the horizontal axis of the bar chart to reflect the values of an additional attribute, the Series Expression would be the expression for the secondary level of detail. In the example shown below, the x-axis reflects the land priorities (e.g., Low, Medium, or High). In addition to displaying the priority, the bars of the chart use a different colour to reflect those land which block water access (red) vs. those that do not block the water (blue).
#:[[Image:iRep31.png|center|500px|''Figure 31. Bar chart with different series expression'']]<div align="center">''Figure 31. Bar chart with different series Expression''</div>
#* '''Finally, the Series value can be left blank if desired.'''
# The next step is to provide the correct data for the chart to use. Bar charts require a '''category expression''' and a '''value expression''' where the value expression is a field to group the data by (i.e. the names of the X axis) and value expression is the value to sum.
#:[[Image:iReport Chart BarPreview.png|center|500px|''Preview with Chart'']]<div align="center">''Preview with chart''</div>
====Modify a Bar ChartsChart====__NOEDITSECTION__Once a bar chart has been created in iReport Designer, its properties can be edited by selecting the '''Chart Data''' option on the right click menu and adjusting the values and properties.  To modify a bar chart:# Right click on the chart in iReport Designer and select '''Chart Data''' from the menu.# The Chart Data properties display.# 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 Chart Bar ChartData1.png|center|500px|''Chart Data Properties'']]<div align="center">''Chart Data Properties''</div># For Bar Charts this presents the '''Category Series''' chooser. Typically there will be only one or two series to choose from here though more can be added at this point. Select the series to modify and choose '''Modify'''.# The Chart Data properties window will display#: [[Image:IReport Chart Bar ChartData2.png|center|500px|''Chart Data Properties'']]<div align="center">''Chart Data Properties''</div># In this window, the basic properties of the bar chart that were established in the Chart Wizard can be edited. These include:#*'''Series Expression''': the field used to first group data for charting purposes. To change the field, simply select another field. '''Note:''' while this field is required it can be made blank or fixed by being set to a constant such as: "" or "Blank".#*'''Category Expression''': the field used to group data for charting purposes. To change the field, simply select another field. '''Note:''' The field must be used in the creation of the variable used in the value expression or the results will be incorrect.#* '''Value Expression''': the variable used to store the data to be displayed in the chart. If changes are made this value it is recommended to edit the variable properties as well.#* '''Label Expression''': the area used to define the labels for the chart. Any valid expression can be used here. See [[Summarize iReport Template Data#Variable Expressions|Variable Expressions]] for more details. {{NavBox HowTo Standardizing Data Analysis and Information Reporting}}[[Category:VIE]]
4,913
edits

Navigation menu