This tutorial demonstrates how to filter a report's data based on a certain condition.
See Conditionally Filter Report Data to learn about the alternative approach to solving this task.
See Data Binding Modes to learn more about the available binding modes.
The report created in this tutorial displays products having the price exceeding $50:
Do the following to conditionally filter report data:
Then, in the invoked Formatting Rules Editor, click the Edit Rule Sheet... button.
In the invoked Formatting Rule Sheet Editor, click , to create a new formatting rule. For this rule, set the Visible property to false.
Next, locate the FormattingRule.Condition property and click its ellipsis button. The Condition Editor will appear.
In this editor, define a Boolean expression for the rule (e.g., [UnitPrice] <= 50). The [UnitPrice] <= 50 expression means that the UnitPrice data field should be less than or equal to 50 for the appropriate data row to be hidden.
Click OK to save the changes and close the dialog. Then click Close to quit the Formatting Rule Sheet Editor.
In the Formatting Rules Editor, you can see the created rule (called formattingRule1), which should be moved to the list of active rules on the right using the arrow buttons in the center of the dialog box.
In this editor, you can also customize the precedence of formatting rules using the up and down arrow buttons on the right of the dialog box. The rules are applied in the same order that they appear in the list, and the last rule in the list has the highest priority.