Bind Subreport datasource FROM Main Report

4 posts, 0 answers
  1. Shawn
    Shawn avatar
    1 posts
    Member since:
    Jan 2009

    Posted 26 Feb 2013 Link to this post

    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
  2. Ben Alexandra
    Ben Alexandra avatar
    7 posts
    Member since:
    Sep 2012

    Posted 26 Feb 2013 Link to this post

    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
  3. DevCraft banner
  4. Ben Alexandra
    Ben Alexandra avatar
    7 posts
    Member since:
    Sep 2012

    Posted 27 Feb 2013 Link to this post

    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).
  5. Stef
    Admin
    Stef avatar
    3050 posts

    Posted 27 Feb 2013 Link to this post

    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!

Back to Top