Bind a Report to a Data Source

Supported Data Sources

DevExpress Reporting allows you to bind reports to the following data sources:

Specify a Data Source

You can use the Report Wizard to connect a report to a data source. This specifies the report's XtraReportBase.DataSource and XtraReportBase.DataMember properties.

report-data-bindings

You can create an unbound report and use the Data Source Wizard to connect the report to a data source when required. Expand the DataSource property editor and click Add Report Data Source to run the Data Source Wizard.

The Report Wizard and Data Source Wizard allow you to perform the following actions:

  • Bind the report to popular data providers, including SQL, Entity Framework, Excel and object data sources;
  • Use a UI to create master-detail relations between data tables and views;
  • Invoke a Query Builder to shape report data.

After you connected a report to a data source, the available data fields are listed in the Field List. You can drop fields from the Field List onto the report to arrange data-aware controls.

how-to-sql-data-source06

Reuse a Report's Data Source

You can reuse a report's data source in other reports.

  1. Add a data source to the Report Gallery.

    Right-click a report's data source in the Field List or Report Explorer and add it to the Report Gallery.

    design-time-field-list-data-source-add-to-gallery

  2. Assign an existing data source to a report.

    Select a data source from the Components section in the Report Gallery and click Add to Report Components.

    report-gallery-apply-component-template

Bind a Report at Design Time and Load Data at Runtime

You can adjust a report's layout and bind report controls to data fields at design time, but load actual data at runtime when the report is generated. Use one of the following approaches to accomplish this task for different data sources: