How to: Apply Conditional Visibility Controls
Some reports have data that is printed conditionally. For example, if the request page for the report has a Show Address Details check box, then the address details are printed only if the check box is selected. Another example is a report that could show data based on a value such as a balance. If the balance is 0, then the report does not show the balance. To specify conditional visibility in an RDLC report layout, use an expression on the Visibility property of the report item or table row.
To specify conditional visibility controls
In the development environment, on the Tools menu, choose Object Designer.
In Object Designer, choose Report, select the report that you want to modify, and then choose Design.
On the View menu, choose Layout.
In Visual Studio, in the Report.rdlc file, select the control or table row that you want to show conditionally.
On the View menu, choose Properties Window.
In the Properties window, expand Visibility.
Under Visibility, in the Hidden field, select <Expression…> from the drop-down list.
In the Expression window, enter the conditional statement for when the control or row is hidden, and then choose the OK button.
The following illustration shows an example of a conditional visibility expression on report 116, Statement, in the CRONUS International Ltd. demonstration database.