''Land grouped by location''
</div>
====Adding a Group to an Existing Report====__NOEDITSECTION__ {{note|The field on which you would like to group your report results must be included in the report.}} To add a group to an existing report:<ol><li>From the '''View''' menu, select '''Report Groups'''.</li><li>A window displays the groups for the report.</li><li>Click the '''New''' button.</li>:The Add/modify group window displays. <li>Enter an identifier for the group. This should be a meaningful name that allows you to easily identify the contents of the group such as the field on which the results are grouped.</li><li>Click the [[Image:iRepExpress.png]] icon.</li>:The Expression editor window displays.<li>Ensure that the Objects and expressions tab is selected.</li><li>Click '''Fields'''.</li><li>Double-click the name of the field on which you would like to add a grouping.</li>:The Expression editor window shows $F{FieldName} where FieldName is the name of the field that you selected previously. <li>Click the '''Apply''' button.</li>:The Add/modify group window displays the expression in the Group Expression field. <li>Click the '''OK''' button.</li>:The Add/modify group window closes. </ol> {{note|You may also enter the expression in the Group Expression field if you know the exact spelling of the field name on which you would like to group the results. The syntax is $F{''FieldName''}.}} ===Adding Fields===__NOEDITSECTION__<p>If you need to include a field that was not selected while using the Report Wizard, you will need to know the name of the field that is used by the data source. Find a list of available field names by using the Report Wizard.</p> <p>To add a field to your report:</p><ol><li>From the '''View''' menu, select the '''Fields''' option.</li>:A window displays three tabs (Fields, Variables, and Parameters).<li>From the Fields tab, click the '''New''' button.</li>:The Add/modify field window displays.<li>In the '''Field Name''' field, enter the name of the field that you would like to include.</li><li>Click the '''OK''' button.</li>:The field is included on the Fields tab.<li>Close the window that displays the Fields, Variables, and Parameters tabs.</li><li>Reposition the fields on your report as needed to accommodate the new field.</li><li>Click the [[Image:iRepF.pngModify an iReport Template]] icon.</li><li>Click the detail section of the report.</li><li>While holding down the mouse button, drag the cursor to form the rectangle which will contain the new field.</li><li>Release the mouse button.</li>:A placeholder for the field is displayed in the design section of the report. <li>Double-click the placeholder that was added for the field.</li><li>Change the placeholder text so that the field that you added is between the brackets.</li></ol> ===Sorting Report Results===__NOEDITSECTION__It may be helpful to sort the report results using the value in one or more of the fields. Sorting the results makes it easier to review the results and locate any records that you may be searching for. To sort report results:<ol start="13"><li>Create the report.</li><li>From the '''Data''' menu, select the '''Report Query''' option.</li>:The Report query window displays.<li>Click the '''Sort options''' button that is located at the bottom of the Report query window.</li>:The Sorting Options window displays. <li>Click the '''Add Field''' button.</li>:The Sort Field window displays. The Sort by list displays all the fields that you have selected for the report. <li>From the '''Sort by''' list, select the field by which you would like to sort the report results.</li></ol> {{note|When sorting data in reports that contain groups, ensure the “Group by” fields appear first in the sort order.}} <ol start="18"><li>From the '''Sort Type''' list, select either the ''Ascending'' or ''Descending'' sort order.</li><li>Click the '''OK''' button.</li>:The selected field displays in the Sorting Options window. <li>Repeat steps 4-7 for each field on which you would like to sort the results.</li><li>After you have completed adding the fields on which you would like to sort the results, click the '''Close''' button.</li>:The Sorting Options window closes. <li>From the Report query window, click the '''OK''' button.</li>:The Report query window closes.</ol> <p>You will need to compile and execute the report for the sort options to take effect.</p>
{{NavBox HowTo use iReport}}