Company logo

Articles, tips and FAQs for Crystal Reports

Home | Contact

Warn the user when a group continues on the next page

A simple formula for creating a group continuation message

You probably know that Crystal Reports has a 'Keep group together' option. When this option is enabled, CR will keep the group from breaking across pages where possible. However, since some groups might take up more than one page, there might be times when a page break within a group is unavoidable. There might also be times when you prefer not to enable the 'Keep group together' option.

When a group overflows a page break, you can help your users by adding a group continuation message to the page footer, as shown in Figure 1.

Figure 1: A helpful message at the foot of the page

To create this message, all you need to do is to drop a simple formula into the page footer band. The formula will look something like this:

IF {Customer.Country} = NEXT({Customer.Country})
 THEN {Customer.Country} + " continues on next page"

In this example, Customer.Country is the grouping field. The formula compares the value of that field in the current record (which is the last one to be printed on the current page) with its value in the next record (the first one to be printed on the following page). If the values are equal, the group will be split across the page break; in that case, the formula will return the required message. If they are not equal, the formula will return a null string, so no message will appear.

Mike Lewis Consultants Ltd. January 2004.

More Crystal Reports articles | Visual FoxPro articles | Recommended books | Contact us

These pages are maintained by Mike Lewis Consultants Ltd. as a service to the CR community. Feel free to download and use any code or components, and to pass around copies of the articles (but please do not remove our copyright notices or disclaimers).

The information given on this site has been carefully checked and is believed to be correct, but no legal liability can be accepted for its use. Do not use code, components or techniques unless you are satisfied that they will work correctly in your applications.

© Copyright Mike Lewis Consultants Ltd.