Controlling Page Breaks

Objective

After completing this lesson, you will be able to display each group on its own page.

Pagination Overview

Use the Paging tab to set properties such as: page breaks, page numbers, orientation, and so on for a desired section.

The image shows a software interface window titled Section Expert, where a user is managing report sections with a list of sections on the left—including Report Header, Page Header, Group Header #1: Customer.Country - A, Details (highlighted), Group Footer #1: Customer.Country - A, Page Footer, and Report Footer—and on the right, options under the Paging tab allow configuration of page breaks such as New Page Before, Reset Page Number After, New Page After with End of Section and Visible Records checkboxes, and page orientation settings with radio buttons for Default (Portrait), Portrait, and Landscape, with navigation buttons OK, Cancel, and Help at the bottom, reflecting a functional and technical setting for customizing report layout and pagination in a clear and organized manner.

The options in the Paging tab are:

New Page Before
New Page Before is an available format property for Group (header and footer) and Details sections. When you select this option, the program inserts a page break before it prints the section. The page break thus comes before:
  • The group (if using the option with a Group footer section).

  • Each report record (if using the option with a Details section).

The Page Header and Page Footer appear on each page. If you have a subtotal or summary field in a Group Footer section, you can use the New Page Before option to put these values on pages following the value being totaled.

Hint

In order to avoid blank pages, use the conditions Not OnFirstRecord and Not OnLastRecord with New Page Before or New Page After
Reset Page Number After

This option causes the page number to return to one after the section is complete. Normally, this feature is applied to a Group Footer. Therefore, if one group spans several pages, you see page 1, page 2, and so on, of the group. Then, when Crystal Reports goes to the next group, you see page 1, page 2, and so on, again.

New Page After

When the End of Section checkbox is selected, the program inserts a page break after the section.

  • The Page Header and Page Footer appear on each page.

  • Use New Page After in the Group footer section to print each group on a separate page.

When the Visible Records checkbox is selected, the program inserts a page break after a specific number of records.

Note

  • This feature applies only to visible records. Suppressed records may be contained on a page, but will not count toward visible records.

  • This option appears only when you have selected the Details section in the Sections list.

Orientation

Allows you to set page orientation for each section in the report except for the Page Header and Page Footer. The default setting will be the same as the report page orientation in the Page Setup dialog box.

Keep Group Together

Use the Keep Group Together option if you want to avoid breaking up groups across pages.

If a group extends beyond a single page, Crystal Reports begins printing the group at the top of the next empty page, but then breaks the group across pages as necessary.

If the first group in a report extends beyond a single page, and the Keep Group Together checkbox is selected, Crystal Reports begins printing the group on the second page of the report, instead of the first. To avoid this behavior on the first page of the report, clear the Respect Keep Group Together On First Page checkbox in the Report Options dialog box.

Note

This option does not appear for the Cross-Tab Group Options dialog box.
Repeat Group Header On Each Page

If you want your group header to repeat on the page following a break within a group, then enable Repeat Group Head On Each Page option. The group header will then repeat for every successive page.

Note

This option does not appear for the Cross-Tab Group Options dialog box.

Set Page Breaks in a Report

In this exercise, you will set page breaks in a report.

Summary

  • Use "New Page Before" or "New Page After" to insert page breaks before or after specific sections, such as group headers/footers or detail sections, to control the flow of records across pages.
  • Employ "Reset Page Number After" to restart page numbering at 1 after a designated section, typically a group footer, for organized pagination.
  • Apply "Keep Group Together" to prevent groups from splitting across pages and "Repeat Group Header On Each Page" to ensure headers are repeated on every new page within a group for better readability.