Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Create criteria between sub report and main Post Reply Post New Topic
Author Message
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Topic: Create criteria between sub report and main
    Posted: 19 Aug 2014 at 11:09am

I'm using Crystal reports 2008. I have a report that contains a subreport. The main report brings in 3 fields from the sub report, NEXT_STEP, NEXT_PAY_RATE, and a string field. My main report will display a 0 or "at Max, does not qualify" in the shared variables, just like they are supposed to.

I am wondering the process to exclude any employee records from my main report where the subreport returns 0 from NEXT_STEP or NEXT_PAY_RATE). The report gets quite large with these records that we can otherwise ignore, and I just have not used this functionality on any of my reports with subreports yet.
 
Thanks for your help!
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Aug 2014 at 3:21am
it sounds like the determination for exclusion value is found in the sub report so you cannot actually exlude the values from your main report.
It is possible to suppress data in the main report based on a value form the sub report but there are a few things to remember when doing this.
1. YOu have to send the value from the sub-report back to the main report as a shared variable, it cannot just be a dispaly value in the sub-report
2. you cannot suoppress the subreport or it will not run. You can suppress all of the fields in a subreport and then suppress the section that it runs in when it is blank
3. suppression from a shared variable formula can only suppress data below where that value is garnered. meaning if you pull in the value from the subreport into GH1b, GH1a cannot be suppressed. Basically you have to consider making the shared vcariablinto GHa and then move all your other values below that so you can use the resulting variable as a condition.
4. you can only suppress rows so they are still all included in any sumamry withing the main report unless you explicitly exclude them via a running total or variable formula that does the calculations.
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 20 Aug 2014 at 7:50am
I think I understand some of this at a high level. So what I have done so far is go into my Section Expert for GFb and conditionally suppress records that equal 0 in my shared variable. It sucessfully removes the records but leaves a blank space in the GFa. And yes, if I conditionally suppress in my GFa, that doesn't work.
 
So I guess the question is now, is there a way to "hide" the blank lines that appear in GFa, as well as upon export, keep those blanks from appearing? (I apologize if you've addressed a solution for this in the options above, perhaps I just need to understand this better, or maybe there is not a solution?)
 
thank you
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Aug 2014 at 8:40am

if I understand you correctly,

set every field in the subreport to be suppressed.
create a new GHa
place the subreport in that GHa and only the sub report
go into the section expert (in the main report)
set this new GHa to 'Suppress blank section'=True (checked)
 
This allows the subreport to run and return a value while still 'suppressing' it in the main report
now you can pass the value from the subreport to a variable in GHb and use that result for any suppression.
 
Does that help?
 


Edited by DBlank - 20 Aug 2014 at 8:41am
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.