Operation Manual
Sorting, Grouping, and Totaling
Group headers
10
200 Crystal Reports User’s Guide
Live headers for groups based on a formula
When you create a group and use a formula field as a sort-and-group-by field,
the program automatically creates a group name field based on the value
returned by the formula.
For example, if you create this formula:
{customer.CUSTOMER NAME}[1]
and then group on the formula, the program will group your data based on the
first letter in the Customer Name field.
To create a live group header for a group based on a formula, simply insert
the group name field in the Group Header section.
When you run the report, the “A” group will have the letter “A” as a header, the
“B” group will have the letter “B”, and so on. For more information, see
“Grouping by the first letter of a company name” on page 182 and “Grouping
data in intervals” on page 180.
To create a more descriptive header such as “Customers beginning with the
letter B”, see “Group name with text” on page 199.
Headers for custom groups
The final type of header is a header for the types of custom groups created
when data is grouped in a specified order. When using specified order
grouping, both the name for each group and the records that belong in it are
specified. As in the other grouping situations, the program creates a group
name field for each group based on the group names specified.
u
To create a header for custom groups
1. On the View menu, click Field Explorer.
2. In the Field Explorer dialog box, expand the Group Name Fields folder.
3. Select the Group Name field for the custom group and drag it into the
Group Header section for that group.
The program automatically applies each of the group names you assigned to
the appropriate groups.
Note: Make certain that when you assign the names to the groups using the
Define Named Group dialog box, the names you assign are the names you
want to appear as group headers.