</ol>
===Creating Custom Variables===__NOEDITSECTION__In addition to the built-in functions to calculate the number of records and the sum of a field, iReport also allows you to define a other types of variablecalculations. A variable is a named object that stores the result of a calculation. iReport allows you to define new variables and how those variables should be calculated. For example, you may define a variable that calculates the average for a particular field such as the area size. Or, you may wish to display the maximum value of a field. In these situations, you may define a custom variable.
To create a custom variable:
<ol><li>From # Follow the '''View''' menu, select '''Variables'''.</li><li>Click the '''New''' button.</li>:The Add/modify variable window displays.</ol> steps to [[Image:iRep24.pngModify an iReport Template#Adding a Variable to an iReport Template|center|500px|''Figure 24. Add/modify add a variable window''to an iReport]]<div align="center">''Figure 24. Add/modify variable window''</div> <ol start="3"><li>In the '''Variable Name''' field, enter a name for the variable. You should provide a name that is meaningful and indicative of what the value returns.</li><li># From the '''Variable Class Calculation Type''' list, select the data type of the resulting value. The variable class type will depend on the field that you are using in the calculation.</li></ol> {{note|To determine the class type of a field:<ol><li>Right-click the field element in the report pane.</li><li>Select '''Properties'''.</li><li>Select the '''Text Field''' tab.</li>:The class type will be displayed in the '''Text Field Expression Class''' field. </ol>}} <ol start="5"><li>From the '''Calculation Type''' listpane, select the calculation that you would like to perform.</li></ol>
<center>
<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>
[[Image:iRep25.png|center|500px|''Figure 24. Add/modify variable window'']]
<div align="center">
''Figure 25. Reset Type and Reset Group''
</div>
{{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="8">
<li>From the '''Increment Type''' list, select the increment at which the value will need to be evaluated. It is useful when you want to calculate sub-totals.</li>
<li>From the '''Increment Group''' list, select the group at which the variable will be incremented.</li>
<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">
</ol>
{{note|If the Library pane is not displayed, display it by doing the following:<ol><li>From the '''View''' menu, select '''Docking Panes'''.</li><li>From the '''Docking Panes''' menu, select '''Library'''.</li></ol>}} <ol start="11"><li>From the Library pane, click the name of the variable that you created for the average.</li><li>Drag the variable to the summary section of the report.</li></ol>==Crosstabs==__NOEDITSECTION__
???
==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: