How to: Apply Conditional Visibility Controls
Some reports have sections that are printed conditionally. For example, if the request form for the report has a Show Address Details check box, then the address details are printed only if the check box is selected. As another example, a report could show data based on a value such as a balance. If the balance is 0, then the report does not show the balance. In the Classic report layout, you can use section triggers to specify the conditions for showing the data. In a client report definition (RDLC) report layout, section triggers are not supported. To specify conditional visibility in an RDLC report layout, use an expression on the Visibility property of the control or table row.
For an example of applying conditional visibility controls to hide nonfiltered headers, see How to: Hide Nonfiltered Headers.
Before you begin this procedure, you must create a layout suggestion for the report. For more information, see How to: Create a Layout Suggestion.
To transform conditional visibility controls
In the Classic client, on the Tools menu, click Object Designer.
In Object Designer, click Report, select the report that you want to modify, and then click Design.
On the View menu, click 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, click Properties Window.
In the Properties window, expand Visibility.
Under Visibility, in the Hidden field, select <Expression…> from the drop-down list.
In the Edit Expression window, enter the conditional statement for when the control or row is hidden, and then click OK.
The following illustration shows an example of a conditional visibility expression on report 2, General Journal - Test, in the standard application.