Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record counter in the page footer

Status
Not open for further replies.

crystaldev1

Programmer
Nov 6, 2003
232
US
I would like add a record / group counter in the page footer. So if there are 5 groups shown in page 1, then Counter: 5. If there are 4 more in page 2, then Counter: 9. The counter can be records or groups. Thanks so much.

I am using CR 9.
 
Dear Crystaldev1,

You will need to use the 3 formula manual running total method.

First formula initiates or "resets" the variable.
Second formula is placed where you want to evaluate the data.
Third formula is placed where you want to display the value held in the variable.

//formula 1 - initiate variable
//Since you state you need a running total that
//does not reset you will place this formula in
//Report Header. The field can be suppressed.
numbervar grpcnt := 0;
grpcnt

//end formula 1

//formula 2 - evaluate and place in groupheader
// you want to evaluate. Obviously change field
// being checked to the field you have grouped on.

numbervar grpcnt := grpcnt + (if onfirstrecord
then 1
else if previous({Table.GroupField})
<> {Table.GroupField}
then 1
else 0);
grpcnt
//end formula 2

//formula 3
//This formula is placed in the page footer.
whileprintingrecords;
numbervar grpcnt ;

//end formula 3

Hope that helps you,
ro
grpcnt

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top