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

ObjectDatasource issue

1 Answer 55 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Valik
Top achievements
Rank 1
Valik asked on 06 Apr 2017, 12:23 PM

Hello,

 

I'm trying to create new table report based on ObjectDatasource and as result I get empty table duplicates. Please see Screenshot_1.png

Could you please advise how the issue could be solved?

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 10 Apr 2017, 04:15 PM
Hello Valik,

The issue is that at run-time, you create an instance of the report and then you set the report's DataSource property instead of the nested Table item's DataSource property. The result is repeating Detail section with empty Table item - Repeating data problem.


At run-time you can use the Find method to get the nested table item and to update its DataSource property e.g.:
//get the data object - there is no need to use a Data Source component in such case
//http://www.telerik.com/support/kb/reporting/accessing-and-managing-data/details/do-i-need-to-use-a-data-source-component
var data = GetData();
 
//create a new report instance
var report = new Report2();
//get the nested table item by name
var table = report.Items.Find("table1",true)[0] as Telerik.Reporting.Table;
table.DataSource = data;
 
//wrap[ the modified report instance
var IRS = new InstanceReportSource {Reportdocument = report}


Let us know if you need further help.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Valik
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or