Is it possible to bind the report ui component with a object data source at run time?

1 Answer 60 Views
DataServiceDataSource
Guruprasada
Top achievements
Rank 1
Guruprasada asked on 14 Sep 2022, 02:35 PM | edited on 14 Sep 2022, 02:36 PM

I have referred to example solutions and projects provided by Progress/Telerik.

I have a sample WPF application which refers to the Csharp.ReportLibrary project,  and under Csharp.ReportLibrary I have added a Folder which contains .cs component design file(CardSummary.cs in below image). This design file is the ui of my report.

The question is , is it possible to bind this component with a object data source at run time? where the object can be of any user defined type?

Currently by right clicking the object datasource icon and changing properties of DataMember and DataSource, I am only able to bind it to a method within a class file which returns list. (CardSummaryActivity.cs is the class as shown in below image)

 

 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 19 Sep 2022, 09:15 AM

Hello Umesh,

With the ObjectDataSource component, you may use types that are listed in the Supported object types. Note that the last item in the list is custom business objects.

If you need your custom types to be found in design-time, you have to build them in an assembly targeting .NET Framework and reference the assembly in the ReportLibrary project. The Reporting engine utilizes reflection to access the functionality of the ObjectDataSource. For details, you may check the article Connecting the ObjectDataSource component to a Data Source.

You may also assign business objects dynamically to your reports, as explained in the article How to Bind to a BusinessObject. The particular example is for a WinForms viewer, but it is not much different for the WPF viewer.

Regards,
Todor
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
DataServiceDataSource
Asked by
Guruprasada
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or