The groups must be defined in the Crystal Report at design
time for you to manipulate them at run time. You can use any field to group by
at design time because it will be overwritten at run time.
1.
Right click on any white space in the report. Click InsertàGroup from the pop-up menu.
2.
Select Address.City from the list and click the OK button.
Figure 5
3.
Right click on the LastName field in the Details section and select
InsertàSummary from the pop-up menu.
4.
Change the "Calculate This Summary" drop down list to Count.
5.
Change the "Summary Location" drop down list to Group #1:
Address.City - A.
Figure 6
6.
Click the OK button.
7.
This adds a count of the records based on Group 1. When you run the
report you will see this number change as you change the group.
8.
Add a label to the left of the count field so the user will know what it
refers to.
9.
To add the label you need to move the Count Field in the footer to the
right by clicking and dragging it.
10. Right
click to the left of the Count Field and select InsertàText Object from the pop-up menu.
11. Place
the field to the left of the Count Field.
12. Enter
"Count:" for the text and change the format to Bold.
Figure 7
13. Hide
Section1, Section4, and Section5 by right clicking on the section header and
selecting Suppress from the pop-up menu.