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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counter in Multiple Group Footers

Status
Not open for further replies.

DuncanSutcliffe

Technical User
Jul 3, 2002
40
0
0
GB
Using CR 10.

I need to alternate the colouring in a group footer that has multiple sections. Certain sections may be hidden at runtime by a user choice, so I need to set colouring dynamically.

I have followed the usual habit of using a counter. In the report header I set up:

//@Counter
WhilePrintingRecords;
NumberVar i:=1

Then in each section of the group footer I have dropped in:

//@IncrementCounter
WhilePrintingRecords;
NumberVar i;
i:=i+1;
i

In group footer #1a, the counter correctly shows "2". But in group footer #1b, #1c, #1d, etc., I also show "2". I'm not sure if the counter is being reset to 1 each time, or if the number is just not being incremented.

Anyone able to help?

Duncan
 
Solved it myself.

You have to create a new increment formula for each section and place that in the footer section. You can then choose not to increment the counter by doing:

If [logic that controls display of section] = True then i:=i+1;

Fortunately I only have about 8 sections to do this for!

Duncan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top