Data Grouping in Layouts
After designing the basic layout, you may decide that grouping the records by certain fields or other criteria would make the report easier to read. Grouping allows you to separate groups of records visually and display introductory and summary data for each group. The group break is based on a grouping expression. This expression is usually based on one or more table fields but it can be as complex as you like.
When you have groups, your report layout has Group Header and Footer bands, to which you can then add controls. Typically, Group Header bands contain the Field control for the field used for the group. You may add lines, rectangles, rounded rectangles, or any label you want to appear before the first record in a group. Group Footers often contain group totals and other summary information for the group.
You can also specify other options for the groups:
- Printing text in headers and footers to identify specific groups
- Printing each group on a new page
- Resetting page numbers when groups are printed on a new page
If the data source is a table, the records are probably not in the appropriate order for grouping. You can sort and order the data appropriately by setting an index on the table, using an ordered view in the data environment, or using a query as the data source to display the records in groups. The report layout does not actually sort and order your data but processes the records in the same order that they exist in the data source. Sorting and ordering must be done with a view, index, or other form of data manipulation outside the layout.
For example, if a group breaks at the Region field each time the report processes a different region value, it produces a group. It does not recognize that a country at the beginning of the table should be sorted to group with the same country at the end of the table.
See Also
Data Placement Preparation | Refining Page Layout | Modifying Your Layout | Creating Reports and Labels | Integrating Queries and Reports | Adding a Single Group Report