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

Pass Date Range parameter prompt values to Subreport 2

Status
Not open for further replies.

xicana

Technical User
Dec 11, 2003
100
US
This is not something that I created.

I have a subreport (in the main report footer) that doesn't link directly to data in the main report - except that I would like them both to reflect data within the same date ranges. The issue with the way this report is setup is that the users have to remember to run the subreport and run the main report (and change the dates in the select formula in each).

I changed the main report so that the users get prompted for a date range ({TABLE.DATE} in {?Start Date} to {?End Date})...but I don't know how to pass the date range values to the subreport...if I link by the date field that I'm running the date range on, the subreport only pulls for one day in the range (i'm guessing it's the last date in the main report, right before the sub report runs).

My workaround was to also add a date range prompt in the subreport. The problem is that when the report is run the users will be prompted for 2 date ranges (which should be the same, and this could be another potential problem if they don't use the same date ranges).
It's pretty cumbersome and I hope there's some way to make it simpler and make the subreport run without much interaction from the user.



Sandy
 
You should create the same parameters in the subreport, add them to the sub record selection formula, and then in the subreport linking expert, link the parameter from the main report to the corresponding parameter in the subreport by using the dropdown in the lower left corner to select {?start date}, NOT the default ({?pm-?start date}). Repeat for {?end date}. Then you will only get one set of prompts.

-LB
 
That was exactly what I needed!

Thank you.

Sandy
 
Hi there. I'm trying to do this with a date RANGE prompt. Does it work with that or do I need to split out my from date separate from my to date prompt? It's not working and I'm not sure what I'm doing wrong?
 
I don't think a range parameter will pass directly. It might be simplest to change your parameters to {?start} and {?end}. However, you could also create formulas in the main report like this:

//{@start}:
minimum({?daterange})

//{@end}:
maximum({@daterange})

Then use these formulas to link to the date field in the subreport. Then go into the subreport selection formula and make sure it reads:

{table.date} >= {?pm-@start} and
{table.date} < {?pm-@end}+1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top