Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: subreport counter Post Reply Post New Topic
Author Message
ssweeney70
Newbie
Newbie


Joined: 12 Oct 2009
Online Status: Offline
Posts: 2
Quote ssweeney70 Replybullet Topic: subreport counter
     Posted: 12 Oct 2009 at 11:05am
I have a report that displays the grades a student gets in all of his classes.  the student demographics is in the main report and a display of all the assignments and grades along with classfinalgrade are in the subreport.  I can do a counter in the subreport to see how many grades the child receives a c- or less.  I wish not to print anything on the student if that count is >0.  I can do that in the subreport but not within the main report.
 
Suggestions?
 
Shawn
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Oct 2009 at 6:27am
don't quite understand what you want, but shared variables let a subreport 'report back' to the main report.  Depending on when you want the suppression to occur, this might work.  Crystal prints and reads as it goes, so if you print the group header, then in the details the subreport returns a no print situation, the group header is still there.
 
HTH
IP IP Logged
ssweeney70
Newbie
Newbie


Joined: 12 Oct 2009
Online Status: Offline
Posts: 2
Quote ssweeney70 Replybullet Posted: 13 Oct 2009 at 7:58am
I have a counter in the subreport called count, and I want to see what that count would be before it prints out what the subreport does.
 
If that count is greater than zero then i want to supress the report.
 
Hope I explained this better.  If this is doable, could you give me what the script should look like?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Oct 2009 at 6:08am
to be safe, you will need to run the report twice.  Once before the report, and determine to suppress or not.
 
You might be able to run it one.  Make count a shared variable and then in the formatting of the subreport in the suppress, you can enter something like:
shared numbervar count;
count > 0
 
I don't use subreports too often, so I am not sure if you can suppress a report at the same time as it is being 'calculated' based on a result from the report. 
 
HTH
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