Creating multiple groups
When creating multiple groups, the order in which you create them determines how the report groups data. Before you create groups, think about their order. For example, if you want to group data by state, then by city, create the groups in that order. In other words, state is the table or list element’s first, or top‑level, group, and city is the second, or inner, group.
The reports in Figure 9‑23 show the results of creating the state and city groups in different orders.
Figure 9‑23 Results of creating groups in two different orders
The first report shows the output when the state group is the top-level group. The second report shows the output when the city group is the top-level group. Data in the first report is organized logically. The report shows each state in alphabetical order, then the cities are sorted alphabetically within each state. On the other hand, data in the second report is sorted by city first, which results in repeated state headings that are organized in seemingly random order.
Figure 9‑24 shows the report design for the first report. The state field appears in the group header 1 row, and the city field appears in the group header 2 row.
Figure 9‑24 Report design grouping data by state, then by city
Create groups using any of the following procedures. The procedure you use depends on whether you are creating all the groups for the first time or adding groups to an existing group structure.
*To create groups that follow the order of creation, use one of the following procedures:
*Select the table or list, then choose ElementGroupInsert GroupBelow from the main menu to create each group. For example, if you create a state group first and a city group second, the state group is the top‑level group, and the city is the inner group.
*Select the table or list, then choose the Groups tab on Property Editor. Like the previous technique, the order in which you create the groups determines the order in which data is grouped.
*To add a group at the topmost level, right-click the table or list, then choose Insert GroupAbove from the context menu. For example, if you already created a state group and a city group, use Insert GroupAbove to add a country group as the top-level group.
*To add a group at the lowest level, right-click the table or list, then choose Insert GroupBelow from the table or list’s context menu. For example, if you already created a state group, choose Insert GroupBelow to add a city group as the inner group.
*To add a group between two existing groups, use one of the following procedures:
*Right-click the group row above which to create the new group, then choose Insert GroupAbove.
*Right-click the group row below which to create the new group, then choose Insert GroupBelow.
All the techniques display the Edit Group dialog box used to define the properties of a group. If you inadvertently create groups in the wrong order, you can easily change the order of the groups. It is not necessary to delete and recreate the groups.