Skip to main content
A newer version of this page is available. .

List Object

  • 3 minutes to read

This document describes how to bind a report to an object implementing any of the following interfaces:

Tip

You can use this approach when a physical database does not supply a report’s data. This may be necessary, for example, in a multi-tier application where the data layer is separated from the presentation layer, and it is only possible to bind a report to some .NET objects.

See the Quick Guide to Report Data Binding topic to learn about the other data binding approaches.

You can assign a list object directly to a report’s XtraReportBase.DataSource property:

DataBinding - Runtime - Scheme

Tip

You do not need to specify the report’s XtraReportBase.DataMember property when binding to a list containing plain data (a non-normalized list).

Each record in such list is an object whose public properties are treated as individual data fields and whose property values become field values. Do the following to supply your report with data created at runtime:

  • Declare a class whose instances should represent individual data records. This class’s public properties are treated as data fields.
  • Declare a class implementing the IList, ITypedList, IBindingList or IListSource interface. This list serves as the report’s data source. Its elements must be individual data records.

    When you do not need to create a custom list object, you can use an existing object implementing any of these interfaces. For instance, a ArrayList object can serve as the report’s data source, so this step is optional.

  • Create a new list instance and fill it with records.
  • Assign the list to the report’s XtraReportBase.DataSource property.

You cannot bind a report to a list at design time in Visual Studio. To design a report’s layout and bind its controls to data at design time, do one of the following:

The following tutorials demonstrate how to bind a report to a list object:

See Also