Adding Filtering to Table and Crosstab Items
This topic illustrates how to add filters to a Table or Crosstab item's Filters collection using the Report Designer or Report API, where the filtering occurs after data is retrieved by the report.
If you need to filter data on retrieval, see Using Parameters with Data Source objects
Adding filters to Table or Crosstab item using Report Designer
- Open a report in Design view.
- Left-click a Table or a Crosstab item on the design surface to select it.
- Click Filters ellipsis in the property grid. This displays the current list of filters. By default, the list is empty.
- Click New. A new blank filter equation appears.
- In Expression, type or select the expression for the field to filter. To open the Edit Expression Dialog, select the
- In the Operator box, select the operator that you want the filter to use to compare the values in the Expression box and the Value box.
- In the Value box, type the expression or value against which you want the filter to evaluate the value in Expression.
- Click OK.
Adding filters to Table or Crosstab item programatically
Telerik.Reporting.Filter filter1 = new Telerik.Reporting.Filter(); filter1.Expression = "=Fields.ProductID"; filter1.Operator = Telerik.Reporting.FilterOperator.GreaterThan; filter1.Value = "=10"; table1.Filters.Add(filter1);
Dim filter1 As New Telerik.Reporting.Filter() filter1.Expression = "=Fields.ProductID" filter1.Operator = Telerik.Reporting.FilterOperator.GreaterThan filter1.Value = "=10" table1.Filters.Add(filter1)
The Table/Crosstab/List item has a complex structure built by Rows and Column groups, where each group has its own Filters. If you need to limit column, add filters to the corresponding column groups. If you need to limit rows, add filters to the corresponding row groups. The Group Explorer can be used for checking the Table/Crosstab/List item's Row and Column groups.