New to Telerik Reporting? Download free 30-day trial

Connecting the ObjectDataSource component to a Data Source

The purpose of the ObjectDataSource component is to provide business objects data to data items in a declarative manner. The ObjectDataSource.DataSource property should be the assembly qualified name or the Type of the data access layer (class), where the reporting engine will use System.Reflection to create the instance of the class by using its default constructor, and to execute its method specified by the ObjectDataSource.DataMember property.

When you configure the ObjectDataSource component the settings below are obligatory to avoid runtime error due to failed data retrieval:

  • Visual Studio is a 32-bit application, so the report designer is restricted to x86 mode even on x64 platforms, which prevents the ObjectDataSource Wizard from discovering any types from x64 assemblies. The solution is to use different platform configurations: for "Debug" builds it is best to use "Any CPU", while for "Release" builds you can use "x64" instead.

  • Some Data Items (Graph, Map) will call the constructor or the data retrieval method of your business object during design-time. This is required in order to obtain the data, process it, and create a live preview of the data item. For this reason the business object used to feed the data item with data should be accessible during design-time, otherwise the data item will not be able to generate a live preview of the data.

Creating the DataSource

  1. Open Visual Studio and create a new Class Library.

    The Standalone Report Designer is a WPF application built against.NET Framework 4.0. For that reason, it cannot load and resolve classes from assemblies built against.NET Standard 2.1,.NET Core and.NET5. You can see the .NET Standard compatibility chart which explains how and when the assemblies can be loaded in different framework versions.

  2. Add the following piece of code from How to Bind to a BusinessObject.

    class Product
    class Products
    Class Product
    End Class
    Class Products
    End Class
  3. Build the project and close it.


For security reasons the ObjectDataSource can resolve only types that are declared either in the current report's assembly or in AssemblyReferences element nodes in Telerik.Reporting section of application configuration file. During report processing, the ObjectDataSource component tries to resolve its type and if it is not listed in these two places, an exception will be thrown.

  • Configuration in the Visual Studio Report Designer: In this case, you will need to add a reference to the Class Library project or to the dll which contains the data source definition.

  • Configuration in the Standalone Report Designer:

    1. Open the project folder of the Class Library -> bin -> Debug and copy the dll file.

    2. Paste it at the installation folder of the Report designer C:\Program Files (x86)\Progress\Telerik Reporting R3 2022\Report Designer.

    3. Open Telerik.ReportDesigner.exe.config file with a text editor.

    4. Add an AssemblyReferences in Telerik.Reporting section of application configuration file:

      <?xml version="1.0"?>
      <section name="Telerik.Reporting" type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere" />
              <add name="yourAssemblyName"/>

      The additional attributes like version, culture and publicKeyToken are not mandatory, because the.NET runtime can resolve the assembly only by its name. After modifying the configuration file the application needs to be restarted so the new configuration settings will be read again.

Using the ObjectDataSource in the Report

  1. Open the Report Designer and create a new report.

  2. Navigate to Data and click Object Data Source.

  3. Select from the Available data source types and follow the Wizard instructions until the process is completed.

Configuration in the Report Viewers

  1. Add the reference which contains the data source to the project.

  2. Open the project's configuration file and add the same assembly reference like the one required for the Standalone designer.


Sample report that uses Object DataSource can be found at the installation folder of Telerik Reporting C:\Program Files (x86)\Progress\Telerik Reporting R3 2022\Examples\CSharp\.NET Framework\ReportLibrary\DataBinding

In this article