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

Bind Subreport datasource FROM Main Report

3 Answers 328 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 26 Feb 2013, 07:20 PM
Hey All.

We are on Q3 2012 Telerik Reporting.  The example of binding a subreport FROM it's parent report seems to be broken.  If, in the main report, I create a binding on the subReport object, for "ReportSource.DataSource" to "=ReportItem.DataObject.Departments" then what I get is "An error has occurred while processing SubReport 'subReport1': Bindings error - Property 'DataSource' does not exist".  What is the new way we should be doing this?  I have seen examples of setting the binding IN THE CHILD REPORT, but this is not correct.  The parent report, containing hierarchical data, should be able to assign one of it's property's (which contains a list) to the subreport.  Any ideas?  Surely this is possible...

--shawn

Here is a link to the example that no longer works:
http://www.telerik.com/ClientsFiles/329169_SubReportBinding.zip

3 Answers, 1 is accepted

Sort by
0
Ben Alexandra
Top achievements
Rank 2
answered on 26 Feb 2013, 08:03 PM
On this forum post: http://www.telerik.com/community/forums/reporting/telerik-reporting/datasource-binding-for-subreport.aspx there is a link to an old project: This this example http://www.telerik.com/ClientsFiles/329169_SubReportBinding.zip

In this project you can set the subreports's datasource in either the main report or in the subreport.  We are using 2012 Q3 and now it seems like like you have removed the first option and you can now ONLY set the subreport's datasource from the subreport itself using the ReportItem.Parent.DataObject object.

So it seems like you got rid of the option of setting the subreport's datasource from the main report.  If this is true, can you please explain the rationale.

Thanks

Ben
0
Ben Alexandra
Top achievements
Rank 2
answered on 27 Feb 2013, 05:46 PM
I posted a ticket about this (#664137) and was told that you responded here but there was no response here.  Please give a link to your response (if you posted one).
0
Stef
Telerik team
answered on 27 Feb 2013, 06:08 PM
Hi Ben,

Yes, there are changes allowing more flexibility in the choice of how to provide your report document to the SubReport item. Please, take a look at this forum post where my colleague elaborates on our considerations for the change: How do you programmatically bind subreports in Q2 2012?

You can also find attached a modified version of the mentioned sample project, created with Q3 2012 SP1, which illustrates how to use bindings as in the original project and user-defined functions to set the SubReport item's ReportSource.

I hope this helps.

Kind regards,
Stef
the Telerik team

See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!

Tags
General Discussions
Asked by
Shawn
Top achievements
Rank 1
Answers by
Ben Alexandra
Top achievements
Rank 2
Stef
Telerik team
Share this question
or