Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

6.07 Page Breaks

Forcing a Page Break

Page breaks are useful when you want groups to appear on their own pages. It is very common to want groups to appear by themselves so that data is listed separately from the other groups. An example is a report that has to be broken apart and distributed to multiple people. The group is used to identify where one report ends and the next one starts. Use the page breaks so that it is easy to separate the report pages and distribute them to the appropriate people.

Page breaks can be forced to occur either before or after a section. Unfortunately, each option has the problem of causing one blank page to be printed. If you force a page break before a group header, then the first page of the report will be blank. If you force a page break after the group footer, then the last page will be blank. The way around this is to use one of two built-in functions in the conditional formula: OnFirstRecord or OnLastRecord. By doing a Boolean Not in the formula, it temporarily turns suppression off for the section. For example, if you wanted to force a page break after the group footer, use the following formula (using Basic syntax) in the New Page After format option:

Formula = Not OnLastRecord

This formula returns True for every record leading up to the last record. Thus, there is always a page break after the group footer. Once the last record is printed, this formula returns False and the option to force a page break is turned off. The last page will not have a page break printed after it.