Dividing a Report into Sections

Objective

After completing this lesson, you will be able to manage sections in a report.

Advanced Section Formatting Using Formulas

See the following scenario to learn implementing multiple sections.

In a modern glass-walled office, two colleagues stand together at a window covered with orange sticky notes—one gesturing toward them while the other watches—as speech bubbles present a Q&A about using multiple sections in Crystal Reports and a nearby monitor shows a blue pie-chart graphic, creating a focused, collaborative, instructional scene.

The following screenshot shows a report with multiple sections.

A screenshot of a report‑design application titled Create and Rearrange Sections.rpt showing a Customer Sales layout with annotated yellow callouts for Multiple Report Headers and Multiple details, a central horizontal bar chart labeled Last Year's Sales with blue, orange, and green bars and a 2000–2002 legend, and a stacked left‑hand section panel and ruler that list layered report regions (Report Header a/b, Page Header, Group Header #1: Country, Details a/b, Group Footer) plus field labels and placeholders for Customer ID, Customer Name, Last Year's Sales and a Sales by Customer group title.

Formatting in the Section Expert refers to changes to the layout and design of a report. Using formulas to control section formatting, you can draw attention to data, change the presentation of dates, numbers, and other values, hide unwanted sections, and perform a variety of other formatting tasks to give a report a professional appearance.

Benefits of Using Sections in a Report

See the following scenario to learn more on dynamic display of sections.

In a modern conference room, a diverse group of colleagues of mixed genders and ages sit around a wooden table with notebooks and tablets while a presenter in business attire stands and points to a dark screen showing a circular workflow diagram, two comic-style speech balloons containing technical instructions about using the Section Expert and a Boolean formula for suppressing customer records overlay the scene, and a large clipboard icon with checkboxes appears on the right.

Request Text

For customers with a poor track record, those with less than $25,000 in sales, you also want to include additional information to e-mail a coupon to increase sales.

The report has a second Details section, where the optional display of the email for the coupon promotion.

The first Details section, Details a, would have the standard information and would always be displayed. But for Details b, with the optional information, you use the Suppress property with a formula.

Since you want to display the data in Details b only for customers with poor performance, you must suppress it in the opposite scenario.

In this example, because you want to display customers who had less than $25,000 in sales, you want to suppress those customers with sales higher than $25,000 using the formula: {Customer.Last Year's Sales}>25000.

Details are shown in the following screenshot.

A three-panel desktop UI screenshot shows (left) a spreadsheet-style report with customer names, teal‑highlighted email cells and a Last Year's Sales column, (center) a Section Expert settings dialog with a specific section and checkbox highlighted and yellow arrows indicating selection, and (right) the report after the change reflowed into a single narrow column of customer names and sales figures—demonstrating the action of adjusting a report section option to change the layout.

The next steps are shown in the following screenshot.

Screenshot collage of a Crystal Reports interface tutorial showing three linked panels — a left Section Expert dialog with the Suppress (No Drill‑Down) checkbox highlighted, a top‑middle Formula Workshop window displaying the suppression formula {Customer.'Last Year's Sales'} > 25000, and a bottom report preview with the Last Year's Sales column and customer rows highlighted — connected by orange arrows and a Choose x+2 to navigate to Format Formula Editor callout to illustrate how to apply a conditional suppression rule to filter high‑value customer sales in a formatted report.

The Section Expert offers flexibility when formatting different sections of reports. You can turn each option on or off, or you can use a Boolean condition to do this.

A neutral screenshot of a Section Expert dialog box (likely from Crystal Reports) shows the left pane listing report sections—with Report Header highlighted and items like Page Header, Group Header #1: Customer.Country - A, Group Header #2: Customer.Region - A, Details, Group Footers, Page Footer and Report Footer—and the right pane on the Common tab displaying configurable checkboxes (including Keep Together checked and options such as Hide (Drill‑Down OK), Suppress, Print at Bottom of Page, Suppress Blank Section, Underlay Following Sections, plus Read‑only and Relative Positions), small formula buttons beside several options, and action buttons OK, Cancel, and Help at the bottom, conveying a functional interface for adjusting section properties.

A formula button is located adjacent to most of the options in the Section Expert. The options on the Common tab of the Section Expert are on or off properties so the formula entered must return a Boolean value. The result of the formula you use for conditionally formatting the field must return a True/False or Yes/No answer. If the answer is Yes, then the formatting option is applied. If the answer is No, then the formatting option isn't applied.

In the option on the Color tab is an Attribute property. An Attribute property allows you to have a number of alternatives attributes. The ability to apply formatting to sections conditionally increases the power and flexibility of reporting. You can even conditionally apply background colors to sections.

For example, you have a standard sales report with customer information in the Details section. For customers with a poor track record, those with less than $25,000 in sales, you also want to include additional information. You could insert a second Details section, place the optional information in it and format it to only display in the desired situations. The first Details section, Details a, would have the standard information and would always be displayed. But for Details b, with the optional information, you would use the Suppress property with a formula.

Remember you're suppressing a section. Since you want to display the data in Details b only for customers with poor performance, you must suppress it in the opposite scenario. In this example, because you want to display customers who had less than $25,000 in sales, you want to suppress those customers with sales higher than $25,000 using the formula {Customer.Last Year’s Sales} > 25000.

Limitations of Moving Sections

The following are the limitations of moving sections:

  • Groups can be rearranged. The numbers that identify the order of their relative position remains constant. If you move Group Header 1 below Group Header 2, the labels adjust accordingly to the order of the group. The first group remain as #1, and the second group remain as #2.

  • You can only move a subsection (a, b, c) up or down within the section it was created.

  • The letters that identify the subsection describe their relative (as opposed to their original) position. If you move a "c" subsection up, it becomes a "b" subsection. It loses its original "c" designation.

Note

You can move sections by dragging and dropping them in the Report Designer or using the Section Expert.

Impact of Deleted Sections

When deleting sections that include report objects like database or formula fields, they're physically removed from the report. These changes might influence calculations in other parts of the report that are based on these objects. Letter specification of sections "a," "b," or "c" may also change.

Benefits of the Section Expert

The Section Expert gives an overview of existing sections in a report and allows the inserting, deleting, and the merging of sections. It offers flexibility when formatting different sections of a report. You can turn each option on or off, or use a Boolean condition.

Create and Rearrange Sections

In this exercise, you will create and rearrange sections.

Create and Rearrange Sections - Part I

Create and Rearrange Sections - Part II

Summary

  • Report sections can be enhanced using formulas to change layout, hide sections, and format data dynamically.
  • The Section Expert allows flexible formatting with options to turn sections on/off or use Boolean conditions for conditional formatting.
  • Moving or deleting sections can affect calculations and section labels, so it is important to use the Section Expert's overview and formatting flexibility carefully.