Summarizing Data

Objective

After completing this lesson, you will be able to display summaries of grouped data.

Types of Summaries

Crystal Reports include a number of summarizing options.

The side-by-side screenshots display the Insert Summary dialog box from a software interface, where the user is selecting the Customer.Customer Name field to summarize, with the left panel showing the summary type set to Maximum and the summary location set to Grand Total (Report Footer) alongside options and action buttons, while the right panel expands a dropdown menu listing various summary calculation methods including Maximum, Minimum, Count, Distinct count, Mode, and others, all presented in a clean, functional layout typical of report generation tools.

A subtotal is the sum of all values from a single field, from all the records in a group. In a sales report, for example, if you subtotal the amount ordered by sales representative, Crystal Reports gathers all the records that belong to the sales representative and totals the amounts ordered from all the records.

When the program summarizes data, it sorts the data, breaks it into meaningful groups, and then summarizes the values in each group automatically.

Depending on the data type of the field that you plan to summarize, you can:

  • Sum the values in each group.

  • Count all the values or only those values that are distinct from one another.

  • Determine the maximum, minimum, average, or Nth largest value.

  • Calculate up to two kinds of standard deviations and variances.

Inserting Summary Fields

When you insert a summary in your report that contains one or more groups, you have a choice of where to place the field.

When you select the inserted summary field, you can see its full name in the Status bar at the bottom of the Design window.

The summary field automatically lines up with and attaches to the same guideline as the field it was based on.

You can also insert a simple text object as a label beside your summary field as an explanation to make it meaningful for the user. Adding a text object as an explanatory label in front of the summary or subtotal helps to further describe the context of the new summary or subtotal. For example, a subtotal that sums the sales of a particular region could read "Subtotal of Last Year’s Sales by Region."

You can insert summary information in either the Design or Preview tabs. The options available when inserting a summary field vary depending on the type of data you are summarizing.

Organize Data on a Report

In this exercise, you will organize data in a report.

Summary

  • Crystal Reports provides summarizing options like subtotals for grouped data, such as total sales by representative.
  • Automatic Data Summarization in Crystal Reports sorts and groups data, then summarizes it based on the data type, allowing various calculations like sum, count, and averages.
  • Summary fields can be placed in different locations within grouped reports, and adding text labels helps explain their context.