Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Records appear based on condition in subreport Post Reply Post New Topic
Author Message
victoria61485
Newbie
Newbie


Joined: 14 Apr 2010
Online Status: Offline
Posts: 19
Quote victoria61485 Replybullet Topic: Records appear based on condition in subreport
     Posted: 22 Apr 2010 at 3:23am
I have a report with a subreport. I want to use the select expert to pull only records based on data in the subreport. The subreport is linked to each record in the main report by an ID. If the field in the subreport is blank then I want the record in the main report to appear. If the field in the subreport is populated then I do not want to see the record in the main report. When I run the report, only those records with no data in the subreport will print. Is this possible?

Thank you!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Apr 2010 at 3:30am
probably...but you are kind of using the subreport to drive the main report, and usually it is the other way around. 
 
It would seem that there should be a simpler method...maybe make the subreport the driver, or do an outer join to the subreport tables.
 
using the given scenario, I would put a shared variable in the subreport and use that a flag to display or hide the main report record...you would need to reset the flag before running the subreport, because if it is blank, it probably won't return false...you might need to run the subreport twice.
 
Just about anything is possible.
IP IP Logged
victoria61485
Newbie
Newbie


Joined: 14 Apr 2010
Online Status: Offline
Posts: 19
Quote victoria61485 Replybullet Posted: 23 Apr 2010 at 2:17am
Thank you! I can't seem to get anything to work. I might have to just rebuild this report.
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