The articles in this section of the Knowledge Base involve working with Groups for display in your reports. To access the Report Designer, select Toolbox Setup > Design Reports > Design (Report Type) Report. Select New Report to design a report from scratch or New Report from Existing. Select Designer to open Report Designer.
Grouping data is one of the main tasks when rendering reports. Grouping is used both for aesthetic reasons and for the logical separation of Data Rows. There are two bands used in creating grouped reports, the Group Header band, and the Group Footer band.
The Group Header band is responsible for rendering reports that use grouping. Without a Group Header band, it is impossible to generate grouped reports.
The Group Header band is only output once at the beginning of each group. This band is typically used to display header information such as a group name, data, or a grouping condition.
It is necessary to specify a grouping condition using the Group Header band editor, or the Condition property of the band, to create groups within a report.
Figure 02 features a band with three Text Components and an Image Component. The component on the top provides the label for the group. Notice this label is the same as the condition determining the report grouping in the band’s header. The three Text Components beneath the group label are headers for the additional data populating the report. The final component is an Image Component for displaying images of the parts.
When rendering a report, the report generator binds the Group Header to the specified Data band that outputs data rows. There must be a Data band to generate reports because data rows are output using this band and because those data rows are the basis of the grouping in the report. Also, the sorting of the rows can be specified, which affects the order in which the groups are rendered.
Using the standard Footer Band with a grouped report would result in the footer being rendered at the end of the report after all of the groups have been output. When it is necessary to display a footer after each group, use the Group Footer band.
The Group Footer band outputs information that is specific to each group (See Figure 05 for an example of the Group Footer band in use). For example, when it is necessary to display a count for each group, place a Text Component on the Group Footer band and give it the following expression:
To create a grouped report, a condition that establishes the groups must be created. This condition is set using the Condition property of the Group Header band, or by double-clicking the Group Header band and entering the condition in the Expression tab of the Group Condition window.
Conditions for grouping are generally just the name of a Data Column in the Data Source. As an example, Figure 03 features a report that is grouped by materials. All of the Parts with the same Materials will be grouped—the Materials column “{Parts.MaterialName}” is entered as the condition.
The grouping condition used can be any valid value. For example, if you wanted the parts to be grouped according to their names, you could set the condition to a column from the database that contains the necessary part names data “{Parts.Name}.”