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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Paramaters from the Main report to a Subreport 2

Status
Not open for further replies.

lmbean

Programmer
Mar 1, 2001
3
0
0
US
I am using Crw 8.0 Prof

My main report shows lead status by state and city it has a paramater for {?begin date}and {?end date}
I have a subreport which is a graph of lead status and this is grouped by state
I have inserted the graph into the main reports group header (state) and linked on the {state field}.
In order to get the correct results the subreport must pull leads for a specific period of time - ({?begin date} and {?end date})
I don't want the users to have to enter the same date twice - once for the main report and again for the subreport

I would like to pass the begin date and end date from the main report to the subreport

I tried linking the subreport by {state code} and {entered date} and removing the parameter of begin date and end date from the subreport. but the subreport did not pull the correct data

Is this possible?
 
Create parameters on the sub-report then create a link from the main report's parameters to the subreport's parameters. You should only have to fill in the parameter values once.

Make sure your parameters are not a range value as range parameters do not pass very well to subreports. If it is a range, you will need to break it up into a {begin date} and {end date} via formula's.
 
Or you can use shared variables as well.
 
imbean: As Nilsen states the solution is to link your main report parameter to an identical parameter in the sub report. You will find that in the Change Subreport Links dialog if you drop down the lefthand bottom listbox rather than the righthand. Beware there will be 2 parameters shown (one is the newly created parameter which will be used to transfer the value betwwen main and sub) and the other should have the normal parameter name style - it need not be named the same but must be the same type David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top