Filtering Data
If a report is bound to a data source that contains far more data rows than are necessary for processing report creation, you can exclude excessive or undesired data. To accomplish this, construct a filtering expression using single or multiple data fields.
This document describes two approaches to filtering data in the Report Designer.
Filter Data at the Report Level
To filter a report's data, do the following.
Right-click the report and select Edit... in the context menu. In the invoked dialog, click the ellipsis button for the Filter String property.
Then, in the invoked Filter String Editor, specify the filtering expression.
When creating a filter criteria, you can create and edit logical expressions, and also join the expression groups with And, Or, NotAnd, and NotOr operators. In every filter condition, the left part contains either the data field name, or the name of the calculated field, which exists in this data source at the same level. The right part of the condition contains either a certain numerical or string value, or the name of the report parameter.
To access parameters, click the icon on the right, until it turns into a question mark.
To quit the dialog and save the changes, click OK.
Filter Data at the Data Source Level
To filter data before it has been supplied to a report, you can modify a query of an SqlDataSource assigned to the report's Data Source property. To do this, perform the following steps.
Invoke the Manage Queries dialog using one of the following ways.
Switch to the Report Explorer and right-click the data source item under the Components node. In the invoked context menu, select the Manage Queries... command.
Select a data source, and in the Properties Panel, click the ellipsis button for the Queries property.
In the invoked dialog, click the ellipsis button corresponding to the required query.
Next, in the invoked Data Source Wizard, click the Run Query Builder... button.
In the Query Builder, click the Filter... button.
In the invoked Filter Editor, construct a filtering expression that will be used to filter resulting data at the data source level.
Note that it is possible to embed query parameters into the expression.