|
|
| The information in the article refers to |
Crystal Reports
All versions
Conditional formulas
Formula evaluation
Having difficulty formatting information within your crystal reports? Maybe you need to limit your records being display per page.
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!
|
|