Joined: 27 Dec 2006
Location: United Kingdom
Online Status: Offline
Posts: 3
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.
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
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.
Joined: 27 Dec 2006
Location: United Kingdom
Online Status: Offline
Posts: 3
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.
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