This topic explains how to bind reports to data using standard .NET data providers at design time and runtime.
See the Quick Guide to Report Data Binding topic to learn about the other data binding approaches.
Create the following objects to connect a report to a .NET data provider:
The following image illustrates the data binding mechanism described above:
.NET data providers allow you to access standard data types which use different connections and data adapters:
You can also use different third-party data adapters if they can generate and populate a report's dataset.
You can bind a report to a DataSet in the following ways:
You need to fill the dataset with data manually by calling the data adapter's Fill method. For instance, you could do this before previewing or printing the report. However, you can avoid manually filling the dataset by setting the XtraReportBase.DataAdapter property to the data adapter that was used to create the dataset. In this case, the report automatically populates the dataset with data.
It is possible to load only a predefined number of records from a dataset, which can reduce the load on your database server and the time it takes to generate a report when working with large datasets.
Use the XtraReport.PreviewRowCount property to limit the number of data records displayed in a report. It is set to zero value by default, meaning that this property is ignored.
When a bound data source contains more than one data table, you can use the XtraReportBase.DataMember property to specify the list in the data source (normally, this is a table) whose data is used by a report control. This property is set automatically in most cases, but you can change its value if required.