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

Problem with counting records within a group....

Status
Not open for further replies.

itteknik

Technical User
Joined
May 29, 2009
Messages
3
Location
SE
Hi,

I have a problem with counting records, I want to keep increasing the value within a group even after new page. I've tried the WhilePrintingRecords function but that one resets the value for every new page.
This is what I use now.

(In details)
{@Nr}
WhilePrintingRecords;
NumberVar Count;
Count := Count + 1;

(In group header)
{@NrReset}
WhilePrintingRecords;
NumberVar Count := 0;

Any help is most appriciated.

/itteknik
 
If you have group headers repeating on new pages, that's what would happen. You could test if Inrepeatedgroupheader. But it's easier to use some other sort of count. The use of Crystal's automated totals is outlined at FAQ767-6524.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Try this:

WhilePrintingRecords;
If Not InRepeatedGroupHeader then Numbervar Count:=0

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
Hi,
Worked lika a charm, thank you both very much.

/itteknik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top