When you create a group, PowerBuilder creates two new bands for each group:
A group header band
A group trailer band
The bar identifying the band contains:
The number of the group
The name of the band
The name of each column that defines the group
An arrow pointing to the band
You can include any control in the DataWindow object (such as columns, text, and computed fields) in the header and trailer bands of a group.
The contents of the group header band display at the top of each page and after each break in the data.
Typically, you use this band to identify each group. You might move the grouping column from the detail band to the group header band, since it now serves to identify one group rather than each row.
For example, if you group the rows by department and include the department in the group header, the department will display before the first line of data each time the department changes.
At runtime, you see this:
If you do not want a group header to display at the top of each page when you print or display a report, select the Suppress Group Header check box on the General property page for the header. If none of the headers are suppressed, they all display at the top of each page. When a page break coincides with a group break, the group header and any group headers that follow it display even if the Suppress Group Header property is set, but higher level headers are suppressed if the property is set for those headers.
For example, suppose a report has three groups: division, sales region, and sales manager. If all three group headers are suppressed, and a sales region group break coincides with a page break, the division header is suppressed but the sales region and sales manager headers display.
The contents of the group trailer display after the last row for each value that causes a break.
In the group trailer band, you specify the information you want displayed after the last line of identical data for each value in the group. Typically, you include summary statistics here, as described next.