To this point, your exposure to grouping report data has been limited to using the Report Wizard(s) introduced in Hour 4, "Using the Default Report Wizards," and a brief introduction to manual grouping in Hour 5. Grouping data in a report facilitates business user analysis and enables meaningful summarizations. Examples of common and useful groupings in reports include
Crystal Reports provides easy-to-use grouping functionality that enables multiple types of powerful and flexible data grouping. Inserting GroupsTaking either the sample report from this or the previous hour, the flexibility and power of grouping can be realized in a few short steps. Let's assume that senior sales management in a hypothetical company is interested in viewing customer order information by country, in addition to the existing grouping by employee/sales rep.
The results of this new grouping are shown in Figure 6.9. Note that the country grouping is automatically selected to be the lowest-level grouping. This is the standard and expected behavior when inserting new groups, but based on the sales management's request, we will need to edit the grouping order so that country becomes the highest level. We will do that in the next section. Figure 6.9. A sample report with Country and Customer Name groupings.
A last note on the Insert Group dialog is that options around group naming are available for customization. These options are accessed through the Options tab and facilitate the process of making your reports most presentable. For example, in another situation you might want to group on a country code instead of a country name for report processing efficiency (that is, numeric fields are sorted faster than string fields), but you still want to present the actual Country Name in the report. You could perform this customization through the Options tab in the Insert Group dialog as highlighted in Figure 6.11. Figure 6.11. The Options tab of the Insert Group dialog.Re-ordering GroupsAs you can certainly imagine, it is quite common to want to group data by different fields within a single report. It is also quite common to receive multiple reporting requests for different views of data by various levels of grouping some examples might be
During report design, one of these different grouping orders could be created initially as we did in the last section with the groups Customer Name and Country. If the other grouping orders were required, these could be quickly accomplished through either the Crystal Reports Design window or the Group Expert. Working in the left-most report section area of the Design tab of Crystal Reports (not the Preview tab), the different groups (sections) can be dragged and dropped before or after each other, quickly rearranging the grouping order. To complete the sales management's reporting request from the last section (to group by Country at the highest level and Customer below that), follow the following quick steps:
An alternative and powerful method for reordering groups is provided with the Group Expert. It is accessed from the Report menu, and the different groups can be re-ordered through the up and down buttons within the Grouping dialog. This quick re-ordering can present your data in completely different ways, serving multiple analysis requirements with very little report development effort. The next section explores the power of the Group Expert. Using the Group ExpertCrystal Reports provides an easy method to add multiple groups simultaneously and a central location for accessing all your current groups the Group Expert dialog. Accessed from the Report menu, the Group Expert dialog, displayed in Figure 6.13, enables the addition of multiple groups at one time and the quick re-ordering of any specified groups. Figure 6.13. The Group Expert dialog.This dialog enables the selection of multiple groups in one location and provides access to the same functionality as the Insert Group dialog through the Options button. The groups can also be easily re-ordered from within this dialog through use of the up and down arrow buttons, located on the upper right of the dialog area. Grouping on Date/Time FieldsOne type of grouping that is common across most organizations is date-and-time related grouping. Analysts from all industries want to see how numbers (for example, sales revenue, units shipped, units produced, employees hired, and so on) change over various periods of time. To facilitate this type of analysis, Crystal Reports provides some built-in flexibility around date-and-time grouping. When you are creating a group that is based on a Date or Time field, an extra drop-down box will appear in the Insert Group dialog (see Figure 6.14). This extra Print by Section box enables the user to have the detail records in the report automatically grouped by any number of time-related criteria. Examples include By Day, By Hour, By Quarter, or even By Second. These automatic grouping options enable quick time-oriented analysis. Figure 6.14. The Insert Group dialog with the Date/Time grouping drop-down box expanded.Hierarchical GroupingAnother type of special grouping that is available in Crystal Reports is hierarchical grouping. This special type of grouping enables your report data to be dynamically grouped on a hierarchy kept within a single table of your database. To enable hierarchical grouping, a group of the base-level data should be created through the standard Group Creation dialogs described previously. The Hierarchical Group option dialog can then be selected from the Report menu. To walk through a quick example, try the following steps:
|