Search code examples
ssrs-2008ssrs-tablix

Show or hide tablix based on parameter


The scenario is that there should be a dropdown parameter to select table name and when the user clicks on View report, he should see the data from that particular table.

Both the tables have different columns.

I tried creating different datasets for both tables and created two tablix and bound them to their respective datasets and put a condition for show/hide tablix based on expression.

But still I get error that the column(from other table) does not exist when a select a table.

I am new to SSRS, any help would be highly appreciated.


Solution

  • Add a parameter to your report (TablixChosePara). With your different options:

    =1  'Tablix1
    =2  'Tablix2
    

    Then add two tablixes to your report with two different columns or datasets. Then go to tablix properties and write the following expresson under 'Show or hide tablix based on expression'

    =IIF(Parameters!TablixChosePara.Value = 1, True, False)
    

    And fot the second tablix l:

    =IIF(Parameters!TablixChosePara.Value = 2, True, False)