Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Suppressing Groups Post Reply Post New Topic
Author Message
chris
Newbie
Newbie


Joined: 02 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 35
Quote chris Replybullet Topic: Suppressing Groups
     Posted: 02 Dec 2009 at 2:48am
Hi all,
 
I have a report which is set out as follows.
 
GH - Person ID
 
D - Multiple rows showing forms created for a person. I have a formula which looks at each row and tells me if an error has been created - 1 for yes, 0 for no. For info, the forumla uses the next function
 
GF - gives me a total of the number of rows for that group with an error. I have had to use a manual running total to do this (the 3 formula technique)
 
What I now need to do is suppress the groups where all detail rows have no errors. For those groups where an error exists on a detail row, I need it to show all rows for that group even if some of the rows have no error.
 
In the past I have been able to use either Group Selection or Section Expert Suppression but for this report neither option is working.
 
Any ideas greatly appreciated.
 
Thanks
 
Chris
 
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 02 Dec 2009 at 6:22am
unfortunately, short of running a subreport in or before the GH, or getting the data from a stored proc, there isn't a way that I know of to suppress the group in the scenario that you described...  CR doesn't know to suppress the group until the group has been printed...but by then it is too late.
 
Sorry can't be of more help.
IP IP Logged
ishan
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Location: Nepal
Online Status: Offline
Posts: 19
Quote ishan Replybullet Posted: 08 Dec 2009 at 9:07pm
why don't u create a formula named noerror where

noerror contains
{
if error=false then
1
else
0
}



summarize sum of noserror formula in group. And create another group summary field that counts the records.

now goto section expert and click on group header
check on suppress and click on formula

in suppression formula type as follows
{
if group summary field(noerror)=count(no of records in group) then

true

else

false
}


repeat the same formula in suppression formula for group footer and detail section as well.



Hope this works as it worked in mine.

remember that the code in here is just the logic. convert it into your logic as per your database fields and names given to the fields.
Try and see if it works
Ishwor
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