Search code examples
reporting-servicesssrs-tablix

How can I append the results of additional queries to an SSRS report?


I am generating an SSRS report whose results are displayed like so:

enter image description here

I need to append similar query results (same exact query, one different parameter value) to the right of this data, so that one additional result set of data (from a 2nd query) would look something like this (but with different data, of course - this is just copied-and-pasted to show what's needed):

enter image description here

How can I add multiple of these similar-but-distinct result sets so that they can be read from left to right as shown above?


Solution

  • Based on what is written here, this is how I accomplished this:

    I created a new report based on the existing one, and then added a Subreport and then dragged the existing (original) report onto it (I dragged "VariancePricebyProduct_Facelift.rdl" onto the subreport in "VariancePricebyProduct_Facelift_WithSubreports.rdl"). 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:

    enter image description here

    That works. Just to make it plainer, here is how it looks at design time:

    enter image description here

    The mess at the top is "VariancePricebyProduct_Facelift.rdl"; the bit below is a Textbox/Label for the subreport and then the subreport itself.

    And here is how the data looks where the original/base report finishes and the subreport begins:

    enter image description here