Telerik 2012 Q3 -- Binding SubReport

3 posts, 0 answers
  1. Raka
    Raka avatar
    71 posts
    Member since:
    Sep 2011

    Posted 28 Jan 2013 Link to this post

    Hello

    We just converted to this version of Telerik and are having problems with all of our reports that use subreports.
    I have looked at several options that people have suggested but so far no luck. 

    Can someone please help?

    Here is the code that we are using --

    We set SubReportDS with
      MainReport report1 = new MainReport();
      report.SubReportDS = MyData;

    and define SubReprtDS with --

    public object SubReportDS
    {
       set {  

     

     

        MainReport report1 = new MainReport();

     

     

        Telerik.Reporting.

     

    SubReport subReport1 = 
            (Telerik.Reporting.
    SubReport)report1.Items.Find("subReport", true)[0];

     

        Telerik.Reporting.

     

    InstanceReportSource
            (Telerik.Reporting.
    InstanceReportSource) subReport1.ReportSource;

     

        Telerik.Reporting.

     

    Report sub2 = (Telerik.Reporting.Report)irs.ReportDocument;

     

        sub2.DataSource =

     

    value;
        }
    }

    The end result of this is a report that contains that main section which is populated.  It also
    subReport sections but none of the subReport sections have data in them. 

    Any help will be appreciated.
    Thank you - Raka.

     

  2. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 31 Jan 2013 Link to this post

    Hello Sandhia,

    Your code seems to be ok but we cannot be certain as we do not have the full source code. We tested it at our end but we were unable to identify any problems. Therefore we will need additional information about your project and it will be best if you are able to send us a runnable sample so that we are able to reproduce the issue locally - that way we will be able to identify the culprit faster and advise you more accordingly.

    Kind regards,
    IvanY
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  3. Raka
    Raka avatar
    71 posts
    Member since:
    Sep 2011

    Posted 31 Jan 2013 Link to this post

    Hello -- Thanks for your response.  I finally did manage to get it working.

    This code works --
    public object SubDS
    {
    set {
    var sub = (Telerik.Reporting.SubReport)this.Items.Find("subReportName", true)[0];
    InstanceReportSource repSource = (InstanceReportSource)sub.ReportSource;
    Report r = (Report)repSource.ReportDocument;
    r.DataSource = value;
    }
    }

    Thanks
Back to Top