Back to Devexpress

Bind a Report to an Object Data Source

xtrareports-17784-feature-guide-to-devexpress-reports-bind-reports-to-data-business-object-bind-a-report-to-an-object-data-source.md

latest5.6 KB
Original Source

Bind a Report to an Object Data Source

  • Feb 18, 2026
  • 8 minutes to read

This topic describes how to create a report bound to a sample object data source.

Design Time

Open a Windows Forms App (.NET Framework) project in Visual Studio and follow the steps below.

Create a Data Object

  1. Add the Employees CS#/VB file with the following content:

  2. Add the reference to the DevExpress.DataAccess.v25.2 assembly and rebuild the solution.

Run the Report Wizard

Do the following to run the Report Wizard and bind a report to an object data source:

  1. Press Ctrl+Shift+A or click Project | Add New Item in the Visual Studio menu to invoke the Add New Item dialog:

  2. Select DevExpress v25.2 Report and click Add.

  3. In the invoked Report Wizard , select select the first option (“No”) to create a new data connection and click Next.

  4. Select Table Report and click Next.

  5. Choose Object and click Next.

  6. Specify the assembly that contains the data source class definition. To filter the assemblies in the list, you can select the Show only highlighted assemblies check box. For information on how to highlight assemblies, classes, and members, review the following help topic: Highlight Objects, Constructors, and Members.

  7. Select a data source type. Enable the Show only highlighted types checkbox to filter classes in the list.

  8. Select a data source member. Enable the Show only highlighted members checkbox to filter members.

  9. Specify method parameters.

  10. Choose whether to obtain the data source schema or retrieve the actual data from the data source. The schema allows you to edit the report layout without data retrieval.

  11. You can enable the Show only highlighted constructors check box to filter constructors in the list. Select the data source constructor and click Next.

  12. Specify the constructor parameters.

  13. Select the data fields that the report should display and click Next.

  14. Group report data against one or more fields. You can click Next to skip this step.

  15. Specify the report title and click Finish.

View the Result

The Visual Studio Report Designer displays the report layout:

Switch to the Preview tab to view the report document with data:

Change the Data Source Settings

You can select the data source in the Report Explorer and switch to the Properties panel to change the data source settings.

Runtime

Follow the steps below to create a report and bind it to an object data source in code:

  1. Create the object data source as described in the Create a Data Object section.

  2. Add the ReportHelper.cs file with the following content:

  3. Use the following code to preview a report:

View Example: How to Bind a Report to an Object Data Source at Runtime

Web Application Specifics

Review the following help topics for more information on the object data source in a web application:

|

Create an Object Data Source

|

Data Source Wizard - Register Types

| | --- | --- | |

ASP.NET Web Forms

|

ASP.NET Web Forms

| |

ASP.NET MVC

|

ASP.NET MVC

| |

ASP.NET Core

|

ASP.NET Core

| |

Blazor

|

Blazor

|

View Example: How to Use the Object Data Source in Web Reporting Applications

See Also

How to Create a Report Bound to the ObjectDataSource with Constructor Parameters Linked to Report Parameters