Managing Multiple Groups

Objective

After completing this lesson, you will be able to use multiple groups to improve organization of data.

Nested and Multiple Groups

See the following scenario for advanced grouping options.

In a bright, modern atrium with floor-to-ceiling windows, two colleagues sit on simple chairs amid notebooks, folders and coffee cups—one gesturing with a folder while the other listens intently—engaged in a focused, collaborative conversation about data grouping illustrated by speech bubbles and a sidebar titled Advanced grouping options listing Managing Multiple Groups, Specified Order Grouping, and Grouping on Time-based Data.

Following are some advanced grouping options.

Managing Multiple Groups is very useful when you need to organize data further. For example, by Country, then City, then Customer - or similar hierarchical or multidimensional relationship. You can add and rearrange grouping levels.

The following screenshot shows how to manage multiple groups.

A single screenshot shows a product-report workflow on a computer screen, with the left side displaying a previewed, grouped product list (columns: Product ID, Product Name, Price (SRP), Color) containing category headings like Accessory with subgroups youth, mens, and ladies and sample lines such as 6401 Roadster Jr BMX Saddle $12, and the right side showing the report-design view of an application titled Create and Reorder Multiple Groups.rpt with a blue-gradient workspace, rulers and labeled bands (Group Header #1, Group Header #2, Details, Group Footer, Page Header/Footer) and editable field placeholders, clearly illustrating the technical process of designing and previewing grouped report output.

Specified Order Grouping is useful in a situation where:

  • You want to sort the groups manually in a custom order, for example, neither alphabetically nor by summary value in ascending or descending order.
  • You need to combine some values of grouping fields together, for example, placing Germany, Austria, and Switzerland together in a new group called "DACH".

The following screenshot shows how to specify the order grouping.

A screenshot of a Windows report-design interface showing a left-hand supplier list (columns: Supplier ID, Supplier Name, City, Phone, with entries such as Active Outdoors — Bend, Triumph — Ann Arbor, Guardant — Tokyo, Influx — Osaka, Roadster — London) and two overlapping dialog boxes on the right — Change Group Options listing Named Groups (Americas, Asia‑Pacific, EMEA) and Define Named Group where the user names Americas and sets the Supplier Country filter to is one of with Canada and USA — depicting a neutral, task-focused scene of grouping and filtering report data.

Grouping on Time-based Data is important when you need to organize data on a certain data or time interval. For example, you may need a report that shows all the order placed, broken down by year, quarter or month based on a Date field.

The following screenshot shows how to carry out grouping on time-based data.

A desktop screenshot of a report-design application showing (left) a Groups tree with 2024 expanded into month entries, (center) a preview pane titled 2024 and December 2024 with a vertical list of order-like numbers and accompanying counts, and (right) a Change Group Options dialog with Orders.Order Date set to descending and the for each month choice highlighted and linked to the month header by a yellow arrow, conveying a neutral, functional illustration of grouping report data by month.

You aren't limited to one level of grouping within Crystal Reports. You can have groups within groups.

A screenshot of a report designer titled Report1 in Design view showing a white canvas with horizontal band lines and rulers and a blue left pane labeling sections (Report Header, Page Header, Group Header #1: Customer.Country - A, Group Header #2: Customer.Region - A, Details, Group Footer #2: Customer.Region - A, Group Footer #1: Customer.Country - A, Report Footer, Page Footer), with bold placeholder text centered in the bands reading Group #1: Country and Group #2: Region and two Customer Name fields aligned toward the right—presenting a structured, hierarchical layout for grouping customer records by country and region.

For example, you can have a report of all customers, broken down by country, and each country in turn broken down by region. You could even go further and have a third level, by city.

To create nested or multiple groups, follow the same steps that you did when you created the first group in your report.

Note

As you add more groups, they're automatically added to the list in the Sort Fields area of the Record Sort Order Expert.

Create and Reorder Multiple Groups

In this exercise, you will create and reorder multiple groups.

Summary

  • Managing Multiple Groups is useful for organizing data in hierarchical or multidimensional relationships, allowing for the addition and rearrangement of grouping levels.
  • Specified Order Grouping enables manual sorting of groups in a custom order and combining specific values.
  • Grouping on Time-based Data is important for organizing data based on specific date or time intervals, such as by year, quarter, or month.