Log In
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
 [Expand]Product Information
 [Collapse]Creating Reports in Visual Studio
  [Expand]Adding a Report to Your .NET Application
  [Expand]Getting Started with DevExpress Reporting
  [Collapse]Detailed Guide to DevExpress Reporting
   [Expand]Storing and Distributing Reports
   [Expand]Providing Data to Reports
   [Collapse]Shaping Report Data
    [Collapse]Data Filtering
      Data Filtering Overview
      Filtering Data at the Report Level
      Filtering Data at the Data Source Level
      Filtering Data at the Data Source Level (Runtime Sample)
    [Expand]Grouping and Sorting
    [Expand]Shaping Data using Expression Bindings
    [Expand]Shaping Data using Legacy Data Bindings
    [Expand]Using Calculated Fields
    [Expand]Using Report Parameters
   [Expand]Report Navigation, Interactivity and Appearance
   [Expand]Reporting API
  [Expand]Detailed Guide to Visual Studio Report Designer
 [Expand]Creating End-User Reporting Applications
 [Expand]API Reference
[Expand]Report Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Data Filtering Overview

  • Limit the Number of Records to be Displayed
    Options described in this section will let you emulate the Top N feature in a sorted report or increase Print Preview performance by rendering only a subset of report data.

  • Filter a SQL Data Source
    If you connect to a large remote data source and you are sure that certain records will not be required, it's best to filter them out using your data connection query.

  • Filter Data Using Report's Settings
    If you want to have the flexibility of loading the entire dataset and filtering it on the client, use the report's settings as described in this section.

  • Conditional Element Visibility
    Use this technique to hide data parts from a detail band when the corresponding data records meet the specified criteria.

Expanded Limit the Number of Records to be Displayed

When working with large data sources, you can reduce the report generation time for Print Preview loading at design time by using the ReportPrintOptions.DetailCountAtDesignTime property of a report. This property specifies how many times the Detail band should be printed at design time in Visual Studio (similar to the TOP clause in SQL).

Related options you might find useful:

Property Description


Enables you to limit the number of records shown in a report at runtime.


Specifies how many times the Detail band should be printed when no data source is defined for the report.

This option can be used to create static reports that are not connected to a data source.


Specifies whether or not a report should be printed if its data source is empty.

Expanded Filter a SQL Data Source

When a report is bound to a SqlDataSource, you can filter data before it has been supplied to a report. To filter query data, first start a query editor:

  • Switch to the Report Explorer or Field List.

  • Right-click the data source item and select Manage Queries.

  • In the Manage Queries window, click the ellipsis button corresponding to the required query.

In the invoked Query Editor, click the Run Query Builder... button and use the Query Builder to specify filter criteria.

The filter string can reference query parameters that can be linked to report parameters.

For detailed instructions on using query parameters, see Filtering Data at the Data Source Level.

Expanded Filter Data Using Report's Settings

To filter data in a report, use the XtraReportBase.FilterString property. To quickly access this property, click the report's smart tag.

In a master-detail report, you can filter detail report data individually.

In the invoked Filter String Editor, specify filter criteria that may reference report parameters and calculated fields.

To learn more about filter criteria syntax, see Creating Criteria.

Expanded Conditional Element Visibility

To change the visibility of specific controls in a report based on one or more logical conditions, use formatting rules.

Consider the following example where the State field is displayed only if the Country value is "USA".

To achieve this, click the report's smart tag and locate the XtraReport.FormattingRuleSheet property.

In the Formatting Rule Sheet Editor, click the plus button to create a new FormattingRule.

Set its Formatting.Visible property to False and specify its FormattingRule.Condition.

To apply the created rule to a control, use its XRControl.FormattingRules property.

To prevent blank areas in place of hidden controls, put these controls into the Panel and set its XRControl.CanShrink property to true.

Expanded See Also

How would you rate this topic?​​​​​​​