How to Use Grouping in Crystal Reports
Grouping data in Crystal Reports software is powerful yet easy. Unlike an SQL "Group By" statement, which aggregates multiple rows of data into a single row, the Crystal Reports "Group" bundles like data with customizable breaks. Defining a Group creates a Group Section, consisting of a Group Header and Group Footer, which bracket raw data in the Detail Section. These brackets are manipulated independently of the data by defining colors, spacing, page-breaking and other options to showcase the raw data and produce a more professional-looking report.
Instructions
-
-
1
Click "Group" in the Insert menu. An "Insert Group" dialogue box allows you to select from available fields. Groups have properties for ordering, custom names, keeping groups together and repeating group headers on each page.
-
2
Click on a field, which is then placed on the report in a newly created "Group Header." Adjust position and properties of the field and Group section as needed.
-
-
3
Add more Groups by repeating Steps 1 and 2. Each added Group (Salaries per Division per Department, for example) will bundle the data it has access to from its parent Group. The Grouped Department, even if existing in multiples Divsions, can only group data from the Division it is currently reporting under.
-
1
Tips & Warnings
Deleting a grouped field, leaving the group section empty, will continue to group the data.
If you're using CR9 or above, reorganize Groups via the "Group Expert" in the Report Menu, and specify custom Groups from the "Group Sort " in the Report Menu.
Delete individual Groups via the "Group Expert" or, from within the design template right-click the Group and select "Delete Group."
You can mimick the SQL "Group By" statement by using formulas based on aggregate functions and placed within a Group.
Groups take precedence over Sorts. Sorting will organize all rows of data within all defined Groups, or at the report level in the absence of Groups.
You cannot get page-breaking data without at least one Group.
References
Resources
- Photo Credit business report image by Christopher Hall from Fotolia.com