Crystal Reports  

Grouping Data

In many reports you need to break the data into groups in order to make it easier to read and to analyze. This section shows you how to group data in a report.

To group report data

  1. Right-click in the Crystal Reports ActiveX Designer, point to Insert and click Group.
  2. In the Insert Group dialog box, from the top drop-down list, select the field you want the data sorted and grouped by.
  3. Select the sort direction from the second drop-down list.
  4. If you want to show a different value in the group header, click the Options tab.
    Tip   By default, the group header of the report will display the value of the field you are grouping on.
  5. Select the Customize Group Name Field check box and choose a new group name.

    For example, if you group by {Customer.CustomerID}, at each change of a group you will see the corresponding customer ID. If you want to display a different value (customer ID as well as customer name), customize the group name field by choosing an alternate data field, or by creating a formula.

    Tip   To hide the group header name, right-click the group header, select Format Field, and click Suppress on the Common tab of the Format Editor.
  6. Click OK.

    Notice that two new sections now appear in the Design tab: Group Header #1 and Group Footer #1. This is how the program shows that the report has been grouped.

See Also

Summarizing Grouped Data | Selecting Top or Bottom N Groups | Totaling Data