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 strongm 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.

lisa13ep

Technical User
Apr 18, 2012
12
US
I have main report with subreport in it. Both have the same parameter prompt to enter date range. How do I pass it from main report into subreport instead of entering in twice? I was looking at the solutions online that say to link through the prameter field and then remove the parameter from the subreport, which I did, but it still prompts to enter date twice, plus (because I tried it several different ways) sometimes it does not pull any info from subreport at all. Please help
 
I'm not sure you can actually link on a range parameter. Try replacing each with start and end parameters. Then in the subreport linking screen, in the lower left corner, use the dropdown to select the actual parameter, not the default {?pm-?startdate}, e.g.

In the subreport go into the record selection formula and change it to reflect:

{table.date} >= {?Start Date} and
{table.date} < {?End Date}+1

-LB
 
You can keep the range parameter in the main report, but you'll need to create formulas for separate Start and End dates and pass them to the subreport.

/@bdate
beforereadingrecords;
minimum({?DateRange})

/@edate
beforereadingrecords;
maximum({?DateRange})
 
After I create them how do I pass them over? And mainly, how would I remove the date range parameter from subreport so it does not show up? Thank you.
 
You pass them to the subreport using the "Change subreport links" dialog.

Right click on the subreport and you'll see it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top