Quick Guide to Report Data Sources

This topic introduces the main concepts of binding reports to data.

Data Binding Overview

The XtraReportBase.DataSource and XtraReportBase.DataMember properties specify a report's data binding.

report-data-bindings

Expanding the DataSource property editor and clicking Add Report Data Source runs the Data Source Wizard whose main features include:

  • Support for a variety of popular data providers, including SQL, Entity Framework, Excel and object data sources;
  • Visual editing of master-detail relations between data tables and views;
  • A powerful Query Builder that enables you to shape report data.

After connecting a report to a data source, the available data fields become listed in the Field List, from where they can be dropped onto the report to create data-aware controls.

how-to-sql-data-source06

Tip

DevExpress Reports provide two different data binding modes: legacy bindings and expression bindings. See Data Binding Modes to learn about the available binding modes.

To reuse a data source in other reports, right-click it in the Field List or Report Explorer and add it to the Report Gallery.

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

To assign an existing data source to a report, select it under the Components section in the Report Gallery and click Add to Report Components.

report-gallery-apply-component-template

Supported Data Sources

See the following documents to learn how to bind a report to specific data providers:

Binding to Multiple Data Sources

A report can only have a single data source assigned to its XtraReportBase.DataSource property. However, you can assign a different data source to a subreport or detail report.

See the following tutorials to learn about using this approach:

Tip

See Merge Reports to learn how to merge pages of different reports into a single document.

You can bind the following report controls to individual data sources, independent of the actual report:

Binding a Report without Loading Data at Design Time

You can avoid loading actual data at design time while still being able to adjust the report's layout and bind report controls to data fields. The real data is loaded at runtime when the report is generated.

Use one of the following approaches to accomplish this task, depending on which data source is assigned to your report: