Search code examples
reporting-servicesssrs-tablixssrs-expression

Hide Tablix on Condition base in SSRS


I've one main report in which I have created two different Tablix. (Both have different dataset)

My question is, How can I hide tablix on condition base in SSRS.

For example:

Parameters!First.Value="Y" then hide only first tablix and show second tablix but if Parameters!First="Y" AND Parameters!Second.Value="Y" then show only first tablix not the second one.

How can I achieve this, Please help.


Solution

  • First Tablix Visibility/Hidden Expression

    =Parameters!First.Value="Y" AND NOT(Parameters!Second.Value="Y")
    

    OR

    =Parameters!First.Value="Y" AND (Parameters!Second.Value<>"Y" OR ISNOTHING(Parameters!Second.Value))
    

    OR

    =IIF(Parameters!First.Value="Y" AND Parameters!Second.Value="Y",False,True)
    

    Second Tablix Visibility/Hidden Expression:

    =Parameters!First.Value="Y" AND Parameters!Second.Value="Y"
    

    OR

    =iif(Parameters!First.Value="Y" AND Parameters!Second.Value="Y", True, False)
    

    First evaluate both hidden expression independtly.

    Note: For expression in SSRS you can write a shortcut expression without using iif.