To specify the grouping columns:
In the DataWindow painter, Select Rows>Create Group from the menu bar.
The Specify Group Columns dialog box displays.
Specify the group columns, as described in “Using the Group presentation style”.
Set the Reset Page Count and New Page on Group Break properties on the General page in the Properties view.
After defining your first group, you can define subgroups, which are groups within the group you just defined.
Select Rows>Create Group from the menu bar and specify the column/expression for the subgroup.
Repeat step 1 to define additional subgroups if you want.
You can specify as many levels of grouping as you need.
PowerBuilder assigns each group a number (or level) when you create the group. The first group you specify becomes group 1, the primary group. The second group becomes group 2, a subgroup within group 1, and so on.
For example, suppose you define two groups. The first group uses the dept_id column and the second group uses the status column.
The rows are grouped first by department (group 1). Within department, rows are grouped by status (group 2). If you specify page breaks for the groups, a page break will occur when any of these values changes.
You use the group’s number to identify it when defining summary statistics for the group. This is described in “Adding summary statistics”.