Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Suppress Data In Main Report based on Sub Report 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: Suppress Data In Main Report based on Sub Report
     Posted: 30 Jul 2012 at 10:36am

I have a Crystal XI report that contains a main report and a subreport. My sub report identifies records using an IF statement that are "OK" and records that require an "Audit". I want to be able to suppress the records in my main report and my subreport where the result = "OK" in my subreport. For example, employee Bob appears on my main report. In the subreport, he shows up as being "OK". I don't want to see him at all on my report. I only want to see the records from my subreport that show "Audit", or are null (some records are null because the employees do not appear in my sub report, and that is fine, I want to see those records).

I am not savvy in Crystal Report language so any simplified explanations would be welcome and greatly appreciated!
Tania
 
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 30 Jul 2012 at 11:13am
Unless you're running the subreport for each record in the main report, you can't do this.  Using shared variables, subreports can return single values.  They WILL NOT return a dataset!  Also, using data from a subreport you can only suppress the view of the records (Suppress Section in the Section Expert) that don't meet your requirements, you cannot suppress the actual selection of these records (in the Select Expert.)
 
If you can write SQL, a better way to handle this might be to create a "Command" that is a SQL select statement to get all of the data for your report.  Frequently you can do things in SQL (like the complex filtering you're looking for) that you can't do when you just use tables in Crystal.  You could also potentially create a view in the database that will return the data for your report.
 
-Dell
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