Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Supressing G1 based on G2 Post Reply Post New Topic
Author Message
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Topic: Supressing G1 based on G2
     Posted: 16 Sep 2011 at 9:27am
I have a report that looks like this

G1 dept     Current Revenue(T)     Previous Revenue(T)            Diff(T)
 G2 name     Current Revenue           Previous Revenue                Difference
 G2 name     Current Revenue           Previous Revenue                Difference
 G2 name     Current Revenue           Previous Revenue                Difference
 G2 name     Current Revenue           Previous Revenue                Difference

I am suppressing the G2 line if the difference is less than -10,000. How can I suppress the G1 line if there are no G2 lines printed?


Thank you for your help.



IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 20 Sep 2011 at 3:28am
you can't.  you need to know that you are going to suppress all the G2 lines before G1 is printed.
 
You would need to write a subreport that determines if any G2 lines are printed and use that result to determine if you need to suppress G1.
 
Personally, I try to avoid subreports, but in situations like this, they are required, unless you are retrieving your data from a stored proc, in which case you can create a column that holds a flag as whether or not to suppress G1.
 
HTH
IP IP Logged
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Posted: 20 Sep 2011 at 3:40am
Thank you for your help. 
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