This is a migrated thread and some comments may be shown as answers.

Working with ObjectDataSource and DataTable

1 Answer 461 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mohan
Top achievements
Rank 1
Mohan asked on 25 Jan 2012, 10:00 PM
Hi Telerik,

After going through Step by Step guide, I figured out ObjectDataSource is the best fit for my case.

Let me give a brief description

-> I have a wpf window (window1) with DataTable populated which needs to be displayed in the report

-> I created report with just the group header. I tried adding ObjectDataSource from the toolbar and Visual Studio got hanged. So I decided adding it in the code like below.

Telerik.Reporting.ObjectDataSource ods = new Telerik.Reporting.ObjectDataSource();

ods.DataSource = d;

Telerik.Reporting.Report r1 = new Telerik.Reporting.Report();

r1.DataSource = ods;

 

-> All the columns in the DataTable will be created and populated based on the value selected in wpf Window (window1). I would like to add this DataTable as a source to my report. 

-> How to declare the fields and association between my datatable and the display fields.

Is it something like since we know the columnnames in the DataTable we need to specify it as [=Fields.MovieName], and so on. assume MovieName is the columnName in DataTable.

Please let me know.

Thanks,
Mohan

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 26 Jan 2012, 09:18 AM
Hello Mohan,

Judging by your description you expect that the report would be data bound similar to grid e.g. autogenerate columns. However this is not the case, and in order for the report to show any data, you should add corresponding Report Items and set their values to valid Expressions from your data source.

Check the following articles for more information:

You can browse the public forum as well in order to find specific information/code sample concerning an aspect of the Reporting features. There are numerous threads which can get you started/assist you through the development process.

Kind regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Mohan
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or