Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Pass date range to sub-report Post Reply Post New Topic
Author Message
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Topic: Pass date range to sub-report
    Posted: 29 Apr 2012 at 11:04pm
Hi all,

I've been having a problem with passing a date range to my sub report. I created 2 parameters in my main report, named StartDate and EndDate. I then created 2 shared variables, with the formulas

StartDate:
shared datevar StartDate;
StartDate := {?Start date};
""

EndDate:
shared datevar EndDate;
EndDate := {?End date};
""

In my subreport, I then created the formulas

StartDate:
shared datevar StartDate;
StartDate

EndDate:
shared datevar EndDate;
EndDate

When I drop these formulas in my report, I get the dates I entered before. However, I need these dates for my date range. But when I try to put them in my Selection Formula, I get the error "This formula cannot be used bacause it must be evaluated later".

Is there anyone who had this problem before, and can help me fix this?

Thanks in advance!

Kind regards,

Gerben
IP IP Logged
amanda5615
Newbie
Newbie


Joined: 20 Apr 2012
Location: United States
Online Status: Offline
Posts: 17
Quote amanda5615 Replybullet Posted: 07 May 2012 at 9:34am
Try adding Whileprinting records before your statement.
IP IP Logged
Pobble
Newbie
Newbie


Joined: 20 Jan 2012
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote Pobble Replybullet Posted: 22 May 2012 at 9:06am
I had the same problem where I wanted to pass the same date range selected in my main report down to the subreport.

I found this and tried it today and it worked for me. Hopefully it will for you.

http://bofocus.com/how-to-pass-a-date-range-to-a-subreport-using-a-parameter/

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.