This document provides the sample, illustrating how to hide bands if a certain logical condition is met. Note that no scripts are required to accomplish this task.
To demonstrate this feature, use a report with grouping, similar to the one created in the following tutorial: Grouping Data.
To conditionally hide bands in a report, do the following.
Select the Group Header band and in the Properties Panel, Appearance category. Then, expand the Formatting Rules section and add a new formatting rule.
Expand the newly created rule and set the Visible property to False. Condition property to specify the logical condition, which will define band visibility.
In the invoked Expression Editor, [CategoryID] < 2) Save.
Apply the formatting rule to the Group Header band by enabling the checkbox for this rule.
Then, apply the same formatting rule to the report's Detail band.
Switch your report to the Preview mode and view the result.