I need to have several (four) reports that are identical except for the value of a particular parameter. I don't want the user to have to enter all parameters manually, though.
When they enter the following parameters:
BEATLES
-------
BegDate: 1962
EndDate: 1970
Unit: Beatles
I want four reports to run, using these parameters:
LENNON
------
BegDate: 1962
EndDate: 1970
Unit: John Lennon
MCCARTNEY
---------
BegDate: 1962
EndDate: 1970
Unit: Paul McCartney
HARRISON
--------
BegDate: 1962
EndDate: 1970
Unit: George Harrison
STARR
-----
BegDate: 1962
EndDate: 1970
Unit: Ringo Starr
So when the user enters the three parameters, the first two ("date") parameters and also the appropriate-for-the-ancillary-report "Unit" parameter ("John Lennon" to the first, "Paul McCartney" to the second, etc.) are passed.
The report "robot" says to itself after the person enters "Beatles" for Unit: "Oh, he entered 'Beatles'! So I'll pass 'John Lennon' as the Unit parameter to the first report, 'Paul McCartney' as the Unit parameter to the second report, " (etc.).
I tried doing this by supplying literal values inside practically-the-same Stored Procedures (as expounded on to some extent here, but it didn't work at all.
So I'm looking for some other way to put multiple related but distinct reports on the same surface. The ultimate goal is to see to it that, when ran and exported as Excel, each report (LENNON, MCCARTNEY, etc.) all display on their own sheet in the Excel file.
For now, though, I just need to know how to pass the appropriate parameters from one report ("BEATLES") to the others ("LENNON", etc.). I'm thinking of these as distinct reports all embedded in one report project/page, but perhaps they needed to be a report and then a bunch of subreports (if you're reading this, you probably know better than I do the inner workings and vagaries of SSRS).
So, how can I supply report parameters to ancillary (sub-?) reports from a "base" SSRS report - or is there another/better way to accomplish this?
Based on what is written here, this is how I accomplished this:
I added a Subreport and then dragged the existing report onto it. Then I selected the context menu item "Subreport Properties" and added a parameter ("Unit"), providing it with a "hard-coded/baked-in" value ("CHOPHOUSE") different from the one to be provided by the user for the main report.
Then, since I want to keep the same date values from the existing report, I added two more parameters to the subreport and set them to use the same values for the date range as those used there in the main report by selecting the "formula" ("fx") button and 2-clicking the appropriate parameter to be used as the passed-in (tramp) value:
That works.
I provided more detail at the answer to the similar question here.