Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: GroupNumber Post Reply Post New Topic
Author Message
Dawton
Newbie
Newbie
Avatar

Joined: 18 Jan 2008
Online Status: Offline
Posts: 6
Quote Dawton Replybullet Topic: GroupNumber
     Posted: 06 Feb 2008 at 5:29am
I have 2-levels grouping in my report. When I use GroupNumber in formula, it is still growing. Is it somehow possible to reset this counter for each group of level 2?
Thanks
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 06 Feb 2008 at 5:34am
If you want to reset the counter, it is probably better to use a Global variable.

In the header of Group1, put a formula that looks like:

Global NumberVar GrpNo := 0

In the header of Group2, put a formula that looks like:

Global NumberVar GrpNo;
GrpNo := GrpNo + 1;
GrpNo

That should both reset the counter with each top-level group, and increment it with each second-level group.


IP IP Logged
Dawton
Newbie
Newbie
Avatar

Joined: 18 Jan 2008
Online Status: Offline
Posts: 6
Quote Dawton Replybullet Posted: 06 Feb 2008 at 5:39am
What is the right place for doing such initializations? In Section expert I can use formulas only for setting some parameters like Colour etc.
Thanks
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 06 Feb 2008 at 5:42am

Hi .......

Can you paste some sample data.....

 

Thanks

Rahul

 

IP IP Logged
Dawton
Newbie
Newbie
Avatar

Joined: 18 Jan 2008
Online Status: Offline
Posts: 6
Quote Dawton Replybullet Posted: 06 Feb 2008 at 5:57am
hi,
what kind of sample data do you mean?
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 07 Feb 2008 at 4:49am
Just add the formula like a text box to the section.  Because the initialization formula doesn't actually return a value, nothing will appear on the report.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum