Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Crystal reports-subreport date paramter Post Reply Post New Topic
Author Message
Nehs
Newbie
Newbie


Joined: 01 Jun 2010
Location: India
Online Status: Offline
Posts: 6
Quote Nehs Replybullet Topic: Crystal reports-subreport date paramter
     Posted: 13 Jan 2011 at 12:04am
Hi,
 
    Am using crystal report 8.5 version..i have an rpt which uses a subreport.
 
Here in the main report am using a filter for from date and To date via Edit selection formula....
 
So in the subreport also i need to filter the records using from date and to date.is there any way to add the main report paramter(fromdate & todate) to the subreport also?
 
Thanks,
Neha.
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jan 2011 at 4:41am
create 2 formulas to convert the params into a formuls field,
chaneg the links in the mainreport to subreport to include these to fields to link onto the date field in the subreport
in the subreport you should now have 2 params in the subreport
alter the select statement to use them as you wanted.
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 13 Jan 2011 at 4:44am
Hi Neha,
Save the main report with a different name say summary sub with the fields you want to display in the subreport.
 
Then do the following
1)Open the main report.
2)Insert Subreport select the saved subreport.
3)Right click the subreport and select change subreport links.
4)In subreport links dialog In available fields select the from and to date parameter of main report and move to Fields to link to list box
5) Then from select data in subreport based on field select the date field  from subreport.
6) once done open the subreport in design mode and you will something similar
 
{CALENDAR.CREATE_DATE} = {?Pm-?From date}
and
{CALENDAR.CREATE_DATE} = {?Pm-?To date}
 
please change the = to sign >= and <=
 
The above settings were based on Crystal version 9 , maybe the settings are different in version 8.5 so please check
 
Cheers
Rahul
IP IP Logged
Nehs
Newbie
Newbie


Joined: 01 Jun 2010
Location: India
Online Status: Offline
Posts: 6
Quote Nehs Replybullet Posted: 13 Jan 2011 at 9:36pm
Hi,
 
Thankyou..It works fine...
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