Data Management Group  
 
TRAINER'S TALK

Limiting Records per Page

The information in the article applies to
All versions Conditional formulas Formula evaluation

Synopsis
Having difficulty formatting information within your crystal reports? Maybe you need to limit your records being display per page.

Solution
Create a manual running total to count the records in the Details section. The running total consists of two formulas: @Reset and @Details.

Example An order must be printed with only 6 records per page.

1. Create the @Reset and @Details formulas:

@Reset - this formula goes into the Page Header. It resets the counter to 0 when SCR moves to a new page.

WhilePrintingRecords;
NumberVar counter := 0

// declare a number variable and assigns
// it a value of zero

@Details - this formula goes in the Details section. It counts each record.

WhilePrintingRecords;
NumberVar counter;
counter := counter + 1

//increments the variable by 1 for each record on the page

2. Use the @Details formula to conditionally force a "New Page After". Every time the counter reaches the sixth record, it moves to a new page and prints the next set of six records.

  • Go to Format | Section, and select the Details section.
  • Click the "X+2" button beside the "New Page After" option (do NOT check the New Page After box). This opens the Condtional Formatting Formula Editor.
  • Enter the following condition:
    {@Details} = 6
This formula forces a new page every time CR reaches the sixth record displayed on every page. The count resets to zero on every page because of the {@reset} formula in the Page Header.


Have a question for our trainers?
Click here to send your questions!


Overview
Crystal Reports Tips & Tricks
Xcelsius Tips & Tricks
Web Intelligence Tips & Tricks
Trainer's Talk

Main | Company | Consulting | Training | Resources | Contact
Copyright © Data Management Group
All Rights Reserved.
DMG
11870 Fountain Way, Suite 502
Newport News, VA 23606
v. 888.394.1664
f. 757.578.4532
GSA Contract Number: GS-35F-0783N