New to Telerik Reporting? Download free 30-day trial

Using the ObjectDataSource Component in Visual Studio Report Designer

Environment

Version Product Author
Visual Studio Report Designer Desislava Yordanova

Description

This tutorial shows how to configure and use the ObjectDataSource component in the Visual Studio Report Designer while creating a Report.

Solution

  1. Let's start with creating a Class library (.NET Framework) project (e.g. CarsLibraryDemo) that will be used as a data collection for feeding the ObjectDataSource. Build the project to produce a dll in the bin folder.
  2. Create another Class library (.NET Framework) project and add a Report class using the Item Templates in Visual Studio. Add a reference to the Class Library project or to the dll that contains the data source definition.
  3. Extend the Visual Studio Report Designer by adding an AssemblyReferences in Telerik.Reporting section of the application configuration file. The 'devenv.exe.config' file resides in 'C:\Program Files (x86)\Microsoft Visual Studio X.0\Common7\IDE' by default (it is recommended to create a backup copy before modifying it).

    <?xml version="1.0"?>
    <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>
    

    Do not forget to close the Visual Studio instance before modifying its configuration file. Run Notepad (or other editing tool) as an administrator to perform the changes.

ObjectDataSource from an External assembly

See Also

In this article