Search code examples
reporting-services.net-4.0ssrs-2008ssrs-tablix

How to display only one of the two tablix in SSRS?


I am very new to SSRS. I want to develop a report. Which has 2 options and you can select either of 2. First option is selection by OrderID and another option is selection by DepartmentName. If you select Option 1 then the report displays a table with the columns related to Order details. If you select Option 2 then the report displays a table with the columns related to Department. Only one table will be displayed at a time.

How can I achieve this, do I need to use a sub report for the 2.


Solution

  • There are many ways you could go about this. A by-no-means-complete list:

    1. Create 2 reports, don't even attempt to merge them. Frankly this makes the most sense; you're laying the foundations for a maintenance nightmare when you start trying to make these "omni-reports" that contain multiple presentations of data, and wonky navigation/visibility rules.

    2. Create a report with two tables, one per dataset. Link the visibility property of each table to the relevant parameter.

    3. Create a master report that calls the appropriate subreport based on a parameter. This isn't quite as simple as it sounds, but it's also not too complicated. You're going to need to write an expression to dynamically choose the subreport, and both subreports will need to accept the same parameter set.