Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Parameter to Subreport

Status
Not open for further replies.
Dec 16, 2008
83
GB
Crystal XI

Hi, in my main report i've got a list of transactions, in my sub report i've got a list status's associated with them transactions and the subreport is linked to the main report by AccountID.

What i'm trying to do is make sure that the parameter ran in the main report runs for the same period in the sub report so that the data off of both reports is for the same period. So what i've done is in the subreport links i've selected the parameter {?QuoteDate} is equal to {@Quote Date} in the subreport. When i run this for say Jan this year, the main report seems to run ok, but the subreport just reports for everything ever. I'm i doing this incorrectly or is there a better method? Do i need to seperate out the Quote Date into Min and Max Quote Date Parameters and then do a formula like this in my select expert in my subreport:

{@Quote Date} in {?Pm-?MinQuote Date} to {?Pm-?MaxQuote Date}


Cheers
 
Using Edit > Report Links you should be able to pass any main-report value down to the subreport.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I think the main problem is that my parameter is a range and the subreport is not recognising this. So would i have to seperate out the Quote Date paremter into min and max dates and then change the select in my subreport in order for it to recognise that it is a range of dates?
 
I would use separate parameters and create the same parameters in the subreport, set up the selection formula in the sub and then link the two sets of parameters to each other. Use the dropdown in the lower left corner of the sub linking screen to select the actual parameter {?start} instead of the default {?pm-?Start}.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top