Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

4.12 Summarizing in a Group

To summarize a field within the groups, right-click on the field that you want to summarize. The pop-up menu gives you the option of inserting a subtotal, a grand total or a summary. Each of these menu options gives you a different dialog box.

Inserting a subtotal brings up the dialog box in Figure 4-10. The top textbox shows the field you clicked on. Below that is a dropdown box that shows the current groups on your report as well as all the other report fields. Normally, you will select one of the existing groups. However, if there are no groups based upon the field you want to associate this summary field with, then click on that field and after you close the dialog box a new group will be created. Ideally, this won’t be necessary because you will plan out your report so that it already has all the necessary groups created.



Figure 4-10. The Insert Subtotal dialog box.

Inserting a Grand Total displays a dialog box that lets you choose which function should be performed on the field. As the report is run, this function is calculated for each field and its total is displayed. After selecting the OK button, the grand total field is added in the Report Footer section and aligned directly below the original field.

Inserting a summary field brings up the dialog box in Figure 4-11. The top dropdown box lets you select which function to perform on the field. The field that you are summarizing is listed below that dropdown box. After that you can select which group to put this summary into. Again, if you pick a field that doesn’t already have a group for it, a new group will be added to your report. At the bottom of the dialog box you can tell it to insert the summary for every group, insert a grand total as well, or sum across a hierarchy. The summary field is placed in the group footer aligned directly below the original field.



Figure 4-11. The Insert Summary dialog box.

By default, the summary field is automatically placed in the group footer. You can move this field to the group header if you want to keep all the summary information in the same section and printed before the detail rows.

To change the summary function after it has been created, right-click on the summary field and select Change Summary Operation. That brings up a dialog box with a dropdown box of all the available summary functions. Select the one you want to change it to and click on the OK button.