Sunday, July 3, 2011

How to limit the number of records in a crystal report ?


For this you need to count records in the details section and reset the count after every nth records. The count can be reset in the header section. NOTE that the header section will be executed, if you break the page every nth record.

So what you need is :

1. A count of records placed in details section ,
and a formula in details section which will increment count for every record displayed on the details section
2. A formula in the header section which will reset this count to 0
3. A page break after the nth value  of counter.

The details can be found at many places on the web, e,g,
LIMITING THE NUMBER OF RECORDS PER PAGE ON A CRYSTAL REPORT
http://www.accuvar.com/tips/crw_records.htm

Header formula : called HeaderReset here
WhilePrintingRecords;
NumberVar counter:=0



Details section formula called  CountDetails here
WhilePrintingRecords;
NumberVar counter;
counter:=counter+1

And a pagebreak after {@CountDetails}= n

NOTE that placement of formulae in the correct section (header or detail) is very important here
to get the correct result

No comments:

Post a Comment

How to check local and global angular versions

 Use the command ng version (or ng v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to f...