Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Suppressing based on count Post Reply Post New Topic
Author Message
elmerbug
Newbie
Newbie


Joined: 30 Apr 2009
Online Status: Offline
Posts: 3
Quote elmerbug Replybullet Topic: Suppressing based on count
     Posted: 14 Jan 2010 at 4:47am
Hello!  I want to suppress headers and detail records IF the count by group <10.  The problem with whileprintingrecords is that the first 9 records get suppressed in a group with 10 or greater records.  If I use whilereadingrecords, it always evaluates to 1 and does not increment.  My formula is:
whileprintingrecords;
numbervar VarTooMany;
VarTooMany := VarTooMany+1
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Jan 2010 at 6:21am
have you tried using the COUNT() function? You can have it count a group, and it doesn't care if they have been suppressed or not, and can be accessed from the group header band.
 
HTH
IP IP Logged
elmerbug
Newbie
Newbie


Joined: 30 Apr 2009
Online Status: Offline
Posts: 3
Quote elmerbug Replybullet Posted: 14 Jan 2010 at 6:35am
Thanks for the tip.  However, the COUNT() function returns the global count; it does not respect the group.
IP IP Logged
saoco77
Senior Member
Senior Member


Joined: 26 Jun 2007
Online Status: Offline
Posts: 104
Quote saoco77 Replybullet Posted: 14 Jan 2010 at 7:13am
Have you tried

count({tbl.field1},{tbl.field2})

field1 represents the information that you are trying to count

field2 represents the grouped field
IP IP Logged
elmerbug
Newbie
Newbie


Joined: 30 Apr 2009
Online Status: Offline
Posts: 3
Quote elmerbug Replybullet Posted: 14 Jan 2010 at 8:27am
Whoo hoo!  Groupie, thanks much.
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