Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Use shared variable as parameter Post Reply Post New Topic
Author Message
duffey01
Newbie
Newbie
Avatar

Joined: 04 May 2009
Location: Australia
Online Status: Offline
Posts: 39
Quote duffey01 Replybullet Topic: Use shared variable as parameter
     Posted: 04 Sep 2013 at 6:45pm
Hi all

I have a main report with four sub-reports and have shared variables displaying info on the main report. One of the shared variables is a date field, shared datevar datewkd. How can I use this as a parameter?

I have used some info from another thread, but, of course, have run into a problem.

I have created a date range parameter field and put in details b (where the sub-report is)and I have added a sub-report link, being, ?Date Range in the main report to datewkd in the sub-report. So I refresh my main report, put in my dates where prompted from the parameter and keep getting the Formula Workshop - Group Selection Formula Editor screen display with {@datevar date worked} = {?Pm-?Date Range} and an info box stating 'This formula cannot be used because it must be evaluated later'

I have tried putting the date range parameter everywhere in my main report, but keep getting the same result.

Any help is greatly appreciated.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Sep 2013 at 5:00am

Do you mean you want to use the same date reange param from teh main report in the sub report?

In teh main report create two formual fields to get the min and max values rom your ?daterange
minimum(?daterange)
maximum(?daterange)
 
now use those two formulas as links on your sub report
these wil now appear as params in your sub report which you can use in the select statement
IP IP Logged
duffey01
Newbie
Newbie
Avatar

Joined: 04 May 2009
Location: Australia
Online Status: Offline
Posts: 39
Quote duffey01 Replybullet Posted: 05 Sep 2013 at 1:43pm
Thanks for that Dblank, I did what you suggested and the following appears in the formula editor;

{@datevar date worked} = {?Pm-@start date}
{@datevar date worked} = {?Pm-@End Date} This line is highlighted.

'The remaining text does not appear to be part of the forumula'

I only want to see data on my main report within a date range, the date being a shared variable.
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