Back to Devexpress

Bind a Report to an IList (Runtime Sample)

xtrareports-2556-feature-guide-to-devexpress-reports-bind-reports-to-data-business-object-bind-a-report-to-an-ilist-runtime-sample.md

latest1.9 KB
Original Source

Bind a Report to an IList (Runtime Sample)

  • Feb 18, 2026
  • 4 minutes to read

This example binds a report at runtime to data generated in an object that implements the IList interface.

Proceed as follows:

  1. Create a new application or open an existing application. For more information, review the following help topic: Get Started with DevExpress Reporting.

  2. Add a new blank report ( XtraReport1 ) to your application. For details, review the following help topic: Create a Report in Visual Studio.

  3. Declare a public AddBoundLabel method in the XtraReport1 class:

  4. Implement a class for an individual record. The code below declares a Record class with the ID , Name , and Age public properties. These properties become data fields.

  5. Create an ArrayList and populate it with the Record objects. Assign the list to the XtraReportBase.DataSource property. Add three XRLabel objects to the report’s Detail band and label controls to data fields. The final code is shown below:

  6. Run the application and load the report at runtime. The report preview is shown below:

See Also

Bind a Report to a List Object

Bind Report Controls to Data Using Expression Bindings