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

Datasource in SubReport doesn't work with Q2 2012

1 Answer 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Flavio
Top achievements
Rank 1
Flavio asked on 28 Sep 2012, 02:22 PM
Hi,

   I have a MasterReport with SubReports which as worked with last version, but when I did upgrade to 2012 Q2 in my project, MasterReport stopped working!

The code below was working in last version and now doesn't work. Occurs this error when I set Data Source. 

this.subReport2.ReportSource.DataSource = listOrdersMonth;


Please, I need to solve it!

Thanks!

1 Answer, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 03 Oct 2012, 08:35 AM
Hello Flavio,

Since the introduction of the new Report Sources things have changed a bit.  What you have to do here is to create your subreport, assign data source to it and only then use the whole report. The code looks like this:
var mySubReport = new MySubReport();
mySubReport.DataSource = myDataSource;
var irs = new InstanceReportSource { ReportDocument = mySubReport };
  
this.subReport2.ReportSource = irs;

Regards,
IvanY
the Telerik team

HAPPY WITH TELERIK 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!

Tags
General Discussions
Asked by
Flavio
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Share this question
or