Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Counting on UnSuppressed Records Post Reply Post New Topic
Author Message
NCR1
Newbie
Newbie


Joined: 01 Oct 2009
Online Status: Offline
Posts: 4
Quote NCR1 Replybullet Topic: Counting on UnSuppressed Records
     Posted: 01 Oct 2009 at 1:36am
Hi,
I had placed all the Database Fields in Group header in order to suppress some records ,
But when am trying to do distinctcount on the records in group footer its also counting the suppressed records .
I need only the count of those records excluding suppressed records in the report.

Any ideas please

Thanks in Advance


Edited by NCR1 - 01 Oct 2009 at 4:56am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 01 Oct 2009 at 6:07am
use a formula with a shared variable.  Every time it an unsupressed record comes along, then increment, this will give a count.  But since you are looking for a distinct count, what I would do is uppercase the value that your distinctly counting, and place it in a delimited string, this way you can search the string to see if that value has already been 'seen'.  Then when it comes time to display the count, split the string on the delimiter, and check the upper bound.
 
Just for completeness, the command mentioned are UpperCase, Split, Ubound, Instr.
 
HTH
IP IP Logged
NCR1
Newbie
Newbie


Joined: 01 Oct 2009
Online Status: Offline
Posts: 4
Quote NCR1 Replybullet Posted: 01 Oct 2009 at 6:55am

Thanks for the reply

am new to CR please can you please explain me the logic to create the formula with a shared variable .
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 01 Oct 2009 at 6:59am
really simple.
 
in the formula:
shared numbervar aVar;
 
done, that is all that is needed to create/access a shared variable.
 
Other things to know.  := assigns to the variable, while = checks if they are the same.
Typically, formulas for this sort of operation come in groups of 3.
1) to reset to 0 (usually in the groupheader)
2) to increment (usually in details)
3) to display the results (usually in group footer)
 
That is pretty much it, rest of formula is the same.
 
HTH
IP IP Logged
NCR1
Newbie
Newbie


Joined: 01 Oct 2009
Online Status: Offline
Posts: 4
Quote NCR1 Replybullet Posted: 01 Oct 2009 at 8:05am
Thanks a lot Lockwelle,
Its working
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