Print Page | Close Window

Linking Sub-Report Prompts to Main Report

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Talk with the Author
Forum Discription: Ask Brian questions about his books and give him your comments. Like the book? Hate the book? Have suggestions? Let me know!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1204
Printed Date: 01 May 2025 at 12:31pm


Topic: Linking Sub-Report Prompts to Main Report
Posted By: Vania
Subject: Linking Sub-Report Prompts to Main Report
Date Posted: 21 Aug 2007 at 2:06am
Hi Brian,
 
I am writing a Crystal Report which requires several sub-reports to collect information because of the data-structure.  I have a prompt in the sub-report which call for a certain set of criteria only i.e. surface type.  I have linked the sub-report to the main report and now would like to filter the information from the main report using the sub-report prompt.
 
Is this possible.  I have read your book and do not find reference to this in there.
 
 


-------------
Regards Vania



Replies:
Posted By: BrianBischof
Date Posted: 21 Aug 2007 at 8:23am
This one is a bit unusual. You can't set the record selection formula to use data from the subreports because at the time the report is run, during Pass #1, the subreport data isn't available yet. So you can't filter on it.

A way around this is to use Shared variables in the subreport and then in the main report I would use conditional formatting on the Details section. Create a formula which uses the Shared variable to determine if the record should be excluded or not. If so, return True so that the record is suppressed. This effectively lets you apply a manual record selection filter on the data and hide the records you don't want shown.

HTH.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window