Data Management Group Crystal Reports Training Boot Camp
Business Objects Authorized Education Partner
Home Corporate Information Training And Education Resources

Business Objects Top Authorized Education Partner for 2004 - View Our Courses

HOME
CORPORATE INFORMATION
TRAINING AND EDUCATION
RESOURCES>>>
RESOURCES > Trainer's Talk > Limiting Records per Page

Limiting Records per Page

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.

 

Sign Up for the BI Advantage Newsletter