Print Page | Close Window

Shared Variables and Report Selection

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=77
Printed Date: 28 Apr 2024 at 3:10pm


Topic: Shared Variables and Report Selection
Posted By: freshbe
Subject: Shared Variables and Report Selection
Date Posted: 27 Dec 2006 at 3:25am
Morning All, I have setup a report using Crystal Reports 9 which contains a main report and approx 9 subreports.  So far so good.  The main report and subreports all use the "currentdate" as part of the Record Selection, also so far so good.  Occasionally when there is a bank holiday for example I need to run the report on the day of return for the previous days, so I have been amending the "currentdate" to "Currentdate -x" etc etc however I need to do this on all subreports.  I thought it would be better to setup a shared variable which I could assign the "Currentdate - x" and reference in the subreports and cutting down on the amount of changes I need to do. 
That's the background now the problem:- I can't seem to get the created shared Variable to be used in the Record Selection of the reports or subreports, is there a way I can do this or another way to achieve my goal please.
Confused



Replies:
Posted By: hilfy
Date Posted: 27 Dec 2006 at 11:46am
A shared variable may not be the easiest solution.  Have you tried creating a formula in your main report and then using that as a parameter to the subreports?
 
The easiest way I've found do that is to set a subreport link on the formula to get the parameter set up in the subreport and then modify the selection criteria in the subreport to use the parameter to filter the dates instead of to link the dates.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: freshbe
Date Posted: 28 Dec 2006 at 6:47am
Thanks for the responses, not in the office now until the 2nd but will most definately give the formula ago and let you know the outcome.  Have a good New Year and watch for the response cheers.Wink
 
 


Posted By: freshbe
Date Posted: 02 Jan 2007 at 9:03am
OK have tried hilfy's suggestion and it works a treat.  Thanks for the responses, look forward to posting another issue soon. Clap



Print Page | Close Window