Friday, June 17, 2005

Limiting Records per Page in Crystal

Limiting Records per Page

Applies to
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.

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.

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.

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 Nice Day
Ritesh Kumar Kesharwani
Software Professional (MCAD)
Cell  :  011-91-9845657636

Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football


Brijesh said...

I was trying to limit number of record per page and i found this solution every where but somehow this solution is not working for more than 14 record means just try to limit record printing to 14 record.
it will fail

Rem said...

Your blog is very nice...
visit my blog example

amol said...

Hey i read ur solution carefully
when i use running total Formula n can't get way to make @Details or @Reset Formula
i tried to make it from Formula Fields and use ur solution there but when i used that @Details Variable to Detail's Section new page after to print only 6 records it shows me message that it requires boolean and when i checked it that @Details Datatype is boolean please give me solution on dis
m waiting for ur reply

Anonymous said...

how viagra works how does viagra work get viagra homemade viagra buy viagra in london england viagra equivalent how to buy viagra viagra strips suppliers of viagra effects of viagra viagra rrp australia viagra blood pressure cheapest viagra in uk viagra professional

Anonymous said...

[url=]hip hop jewelry[/url],[url=]hip hop pendants[/url],hip hop watches,[url=]bling bling[/url] ,hip hop,[url=]hip hop chains[/url],hip hop bling,[url=]iced out chains[/url],[url=]wholesale chains[/url]
hip hop jewelry
wholesale hip hop watches
hip hop rings

Anonymous said...

Order [url=]voltaren online[/url] easy - Patent Offer tegretol online easy - Advantageous Price