New to Telerik Reporting? Start a free 30-day trial

Connecting to a Data Source

Updated on Nov 20, 2026

The ObjectDataSource component provides business object data to data items declaratively. For the type-based setup described here, set the ObjectDataSource.DataSource property to the assembly-qualified name or the Type of the data access layer class. The reporting engine uses System.Reflection to create the class instance with its default constructor and execute the method specified by ObjectDataSource.DataMember.

Configure the following settings to avoid runtime errors caused by failed data retrieval:

  • In Visual Studio versions before 2022, the .NET Framework report designer runs in x86 mode, even on x64 platforms. This prevents the ObjectDataSource configuration wizard from discovering types in x64 assemblies. Use Any CPU for builds loaded by this designer. Choose the Release platform target to match the runtime host; use x64 only if the Reporting engine will run in a 64-bit process. In Visual Studio 2022, the .NET Framework designer runs in the 64-bit Visual Studio process, so make sure the report project's Platform target is not x86.
  • Some report data items, such as Graph and Map, call the business object's constructor or data retrieval method at design time. This process retrieves and processes data to create a live preview. Make sure the business object is accessible at design time.

Creating the Data Source

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

    The Standalone Report Designer for .NET Framework 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 or .NET 8+. You can see the .NET Standard compatibility chart, which explains how and when the assemblies can be loaded in different framework versions.

    The new .NET Standalone Report Designer is built for .NET 10 and can resolve assemblies built with .NET Standard, .NET 8 and later.

  2. Add the following code from binding to a business object.

    C#
    class Product
    {
        //properties
    }
    
    
    [DataObject]
    class Products
    {
        //objects
    }
  3. Build the project.

Configuring the Data Source

For security reasons, the ObjectDataSource resolves only types declared in the current report assembly or in AssemblyReferences elements in the Telerik.Reporting section of the application configuration file. During report processing, the component throws an exception if the type is not listed in either location. Choose the configuration that matches your report designer:

  • Visual Studio Report Designer: Add a reference to the Class Library project or to the DLL that contains the data source definition.

  • Standalone Report Designer:

    1. Open the Class Library project folder, then open bin > Debug, and copy the DLL file.

    2. Paste the DLL file in the Report Designer installation folder: C:\Program Files (x86)\Progress\Telerik Reporting 2026 Q4\Report Designer.

    3. Open the Telerik.ReportDesigner.exe.config file in a text editor.

    4. Add an AssemblyReferences element to the Telerik.Reporting section of the application configuration file:

      XML
      <configuration>
          <configSections>
              <section name="Telerik.Reporting"
                       type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting"
                       allowLocation="true" allowDefinition="Everywhere" />
          </configSections>
          <!-- … -->
          <Telerik.Reporting>
              <assemblyReferences>
                  <add name="yourAssemblyName"/>
              </assemblyReferences>
          </Telerik.Reporting>
          <!-- … -->
      </configuration>

The additional attributes, such as version, culture, and publicKeyToken, are optional because the .NET runtime can resolve the assembly by name. Restart the application after you modify the configuration file so it reads the new settings.

Using the ObjectDataSource in a Report

  1. Open the Report Designer and create a new report.
  2. Navigate to Data and click Object Data Source.
  3. Select a data source type from Available data source types and follow the Wizard instructions until the process is complete.

Configuring the Report Viewer and Web Report Designer

At runtime, the running application's configuration resolves the ObjectDataSource component. In the Standalone Report Designer, this configuration is in the Telerik.ReportDesigner.exe.config file. A Report Viewer or Web Report Designer uses the .config or .json configuration file of the application that displays the report.

If the configuration file does not reference the assembly used by the ObjectDataSource through the AssemblyReferences element, the report displays errors in Preview.

In .NET Framework projects, desktop applications typically use App.config, and web applications use Web.config. .NET applications use JSON-based configuration, most often in appsettings.json. Add the AssemblyReferences element to the Telerik.Reporting section of the XML configuration. In JSON configuration, add the assemblyReferences element to the telerikReporting section.

Use the following steps to reference the assembly in the project that hosts the Telerik Reporting engine:

  1. Add a reference to the assembly used by the ObjectDataSource to the project hosting the Reporting engine. For example, when you use an HTML5-based Report Viewer, this is the Reporting REST Service project. You can also add a Project Reference to the project that builds the assembly. This makes the assembly available in the application's bin folder at runtime.

  2. Open the project's configuration file and add the same assembly reference required for the Standalone designer. For a .NET Framework project, copy the necessary XML. For a .NET project, convert the XML to JSON, as shown in the following example:

    JSON
    "telerikReporting": {
        "assemblyReferences": [
            {
              "name": "yourAssemblyName"
            }
        ]
    }

Configuring the ReportProcessor in .NET

When you render a report that relies on custom assemblies with the ReportProcessor class in a .NET application, pass an IConfiguration instance to the ReportProcessor constructor:

C#
IConfiguration configuration = new ConfigurationBuilder()
    .SetBasePath(Directory.GetCurrentDirectory())
    .AddJsonFile("appsettings.json")
    .Build();

var reportProcessor = new ReportProcessor(configuration);

The appsettings.json configuration file provided to the ReportProcessor must have the assembly registered in the assemblyReferences section as shown in the section above.

Viewing a Sample

Find a sample report that uses ObjectDataSource in the Telerik Reporting installation folder: C:\Program Files (x86)\Progress\Telerik Reporting 2026 Q4\Examples\CSharp\.NET Framework\ReportLibrary\DataBinding.

See Also