Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Shared Variables and Report Selection Post Reply Post New Topic
Author Message
freshbe
Newbie
Newbie
Avatar

Joined: 27 Dec 2006
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote freshbe Replybullet Topic: Shared Variables and Report Selection
    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
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet 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
IP IP Logged
freshbe
Newbie
Newbie
Avatar

Joined: 27 Dec 2006
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote freshbe Replybullet 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
 
 
IP IP Logged
freshbe
Newbie
Newbie
Avatar

Joined: 27 Dec 2006
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote freshbe Replybullet 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
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.