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

Telerik 2012 Q3 -- Binding SubReport

2 Answers 20 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raka
Top achievements
Rank 1
Raka asked on 28 Jan 2013, 08:24 PM
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 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 31 Jan 2013, 05:36 PM
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!

0
Raka
Top achievements
Rank 1
answered on 31 Jan 2013, 07:46 PM
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
Tags
General Discussions
Asked by
Raka
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Raka
Top achievements
Rank 1
Share this question
or