Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Passing Date Range to subreport Post Reply Post New Topic
Author Message
rcgreg
Newbie
Newbie


Joined: 21 Jan 2009
Location: Canada
Online Status: Offline
Posts: 5
Quote rcgreg Replybullet Topic: Passing Date Range to subreport
    Posted: 29 Jan 2009 at 7:35am
Howdy folks
Has anyone passed a date range to a subreport from the main report?
I need a little direction on how to link the parameters for the date range so that the subreport picks them up and does a record selection on the values.
 
Thanks in advance for your help!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 03 Feb 2009 at 6:18am
No, I haven't done this, but my first attempt would be to use shared variables.  You could set them before the call to the subreport, and then the subreport could access them to filter its data.
 
Can't guarantee that it will work, but it is what I would start with.
 
Hope this helps
IP IP Logged
rcgreg
Newbie
Newbie


Joined: 21 Jan 2009
Location: Canada
Online Status: Offline
Posts: 5
Quote rcgreg Replybullet Posted: 03 Feb 2009 at 8:46am
That was my first thought - but the Crystal Help page does not list any variables whose scope extends from main to sub report.:(
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 03 Feb 2009 at 1:24pm
I am pretty sure that shared does, if not Global should
IP IP Logged
Trekmp
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 1
Quote Trekmp Replybullet Posted: 23 Feb 2009 at 8:12am
I've just started with this myself and I found that I just needed to create a parameter in the main report, then create a parameter in the subreport and link them together.
 
Seems to work fairly well with straight forward parameters, just having trouble with date ranges
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 29 Apr 2012 at 10:49pm
Does anyone ever found out how to do this? I created 2 parameters in the main report, and used the shared datevar to pass these to my subreport. When I just drop these in my report, they show me the dates selected, but when I want to put them in my Record Selection, I get the error message "This formula cannot be used bacause it must be evaluated later."

If this isn't possible, I will have to make the end user select the date range twice.

Kind regards,

Gerben

Edited by Gurbs - 29 Apr 2012 at 10:49pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 30 Apr 2012 at 3:26am
since you want to use them as parameters to the subreport, I would link the subreport to the main report using the parameters.
 
passing them in as variables would seem to be too late in the multipass way that CR reads/processes data.
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.