SQLTeam.com | Weblogs | Forums

Changing ssrs 2008 report that has several embedded reports


In a new ssrs 2008 rdl, I am going to combine existing reports into one rdl. The reports that will be executed will be determined by a parameter vale that says what reports are to be selected. Each tablix in the rdl will be displayed based upon the particular parameter value of what reports are selected.

My questions are the following:

  1. If a user wants to change the order of how the reports are displayed in the combined rdl, is there a way to accomplsih that goal? Would you just remove the rdl from its current location and place in the order the user wants to see that report?
  2. If a user wants to delete a report or two from the combined rdl, how would you accomplish this goal? Would you have to go into the rdl and delete the reports that are no longer needed? Would I change the rdl to just never display the reports that need to be deleted?


The questions are not unreasonable, but they do prompt me to bring up a quick point. Which is this: SSRS is a very good reporting tool, but in essence, that's all it is. Dynamic changes are not intended to be part of what is intended to be static data representation. Remembering that will save you many a headache going forward. :slightly_smiling:
That said, I can tell you how to show or hide sub reports using parameters, and I imagine if one were to try hard enough they could move them around, but I cannot speak to that as I would choose a different tool to accomplish it. I highly recommend making a copy of said report before making these changes and working in the copy so you don't accidentally deploy half coded changes.
So; Showing and hiding a sub report/rdl; Create a parameter on your primary report for each rdl you want to give the user an option to see of hide. I recommend using Boolean as it is pretty straightforward. Leave the 'Available Values' section blank; it's Boolean, SSRS knows what to do. In the Default section, add =TRUE (No quotes)
Then in the design view of your main report, select each sub report/rdl that you have a parameter for, one at a time. Over in the Properties box, choose the 'Hidden' property and drop down the select box and choose Expression. Put a simple (albeit necessarily backwards looking) IIF statement in there, something like this:
=IIf(Parameters!ShowRprt1.Value=TRUE,FALSE,TRUE) (Where 'ShowRpt1' is the name of the parameter you built for this particular sub report)
Once those are all done, preview the report and test it out. Feel free to ask for clarifications, I've only had one cup of coffee so far this morning so may not be very clear.