I have a report containing 3 subreports. I need to put a parameter for "transactions dated up to" in the main report, but the transaction dates are held in the subreports. Step by step guide for a numpty, please?
I will assume you have a report with the subreport already created. In the main report, you need to create the date parameter. Click on the "insert fields" icon, then click on "Parameter Fields" and click the "New" icon at the top. Give the parameter a name (let's say "enddate for now", the prompting text and the Value Type (this MUST be the same as the date format you are using in the sub-report, i.e. if one is a Date and the other is a DateTime, it will not work - you can come back and change this later if need be). Save the Parameter.
Next, right click on the subreport in the design window and chose Change Subreport Links. Under available Fields, you should have something like "[?] ?enddate", click on this and then click the ">" buttno to add it as a link. At the bottom of the Subreport Links window, you should now have
"?Pm-?enddate" in the left box, ensure there is a tick in the "Select data in subreport based on:" box and choose the correct field in the drop down box (If you got the wrong choice of Date or DateTime when setting up the parameter, the date field in your table will not appear, go back and change it!). Then click OK to save this. At the moment, this will create a direct link date to date as opposed to the link you need (i.e. one date is less than the other).
Now, open the subreport and click on the "Select Expert" icon, you shuold have an entry for your date field which says "is equal to" and {?Pm-?enddate}. Click the drop down box next to "is equal to" and change it to "is less than or equal to" and click OK.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.