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

Reportbook control - not showing reports

1 Answer 43 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sindu
Top achievements
Rank 1
Sindu asked on 01 Feb 2012, 07:27 AM

Hi,

I have two reports  and code will be given below ..

Report7 objreport1 = new MyReportLib.Report7();
            objreport1.DataSource = dt1;

Report8 objreport1 = new MyReportLib.Report8();
            objreport2.DataSource = dt1;

I want to display these 2 report in ReportBookControl ...

I am using the code ...

ReportBook reportBook = new ReportBook();

 

 

reportBook.Reports.Add(new MyReportLib.Report7());

 

 

 

reportBook.Reports.Add(new MyReportLib.Report8());

 

 

 

ReportBookControl1.Reports.Add(new MyReportLib.Report7());
ReportBookControl1.Reports.Add(new MyReportLib.Report8());

 

 

 

ReportViewer1.Report = ReportBookControl1;

 


but no report is displaying in the report viewer.
How can I display these reports into reportbook control and then to reportviewer.


Thanks In advance .
Sindu.



1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 02 Feb 2012, 03:00 PM
Hello Sindu,

Your confusion comes from the fact that you mistake the ReportBook class with the ReportBookControl class. The latter is meant to be used only if you are using the ReportBook control to add reports through the designer. If you are to add those programmatically, you do not need the ReportBookControl as you can work directly with the ReportBook class and assign it to the ReportViewer. For more info see the Creating a Report Book at run-time section in the Walk-Through for the Web report viewer help article.

Kind regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

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