Click here to Skip to main content
15,868,236 members
Articles / Programming Languages / C#
Article

Multiple Reports with a single Report Viewer Control

Rate me:
Please Sign up or sign in to vote.
2.21/5 (21 votes)
17 Jun 2008CPOL 179.3K   9.6K   39   27
Using this You can embed different reports to a single report viewer control

Introduction

Single Report viewer control can be embedded with multiple Reports
Download the above file for the source code of this project.

Using the code

This code block demonstrates adding of 2 reports to a single report viewer control.
If you have an application in which you are displaying large data in reports and on the same page you need more than one report, instead of adding multiple report viewer controls for different reports. You can add reports one by one to a single report viewer control.


    //Add this code to embed a report at runtime
        reportViewer1.Reset();
        reportViewer1.LocalReport.ReportEmbeddedResource = "ReportViewer.Report2.rdlc";
        this.reportViewer1.RefreshReport();
    //reportViewer1--> A Report Viewer Control
//ReportViewer --> Name of the solution
//Report2.rdlc --> Name of the report

Instead of adding a report to the control using the graphical user interface, add it during the runtime so that after reseting the report viewer control you can add more reports to it.

If any queries, post your comments, i will be glad to reply.

Reference: http://aspalliance.com/762

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Tarkia
India India
He works on c#.net with TARKIA

Comments and Discussions

 
QuestionHOW TO OPEN MULTIPLE CRYSTAL REPORT VIEWER AT THE SAME TIME? Pin
nomi9-Feb-12 21:30
nomi9-Feb-12 21:30 
CAN ANY ONE TELL HOW TO OPEN MULTIPLE VIEWER AT THE SAME TIME , IN ASP.NET C#.
PLEASE SHARE THE CODE WITH THANKS AT NOMANFORU@GMAIL.COM
REGARDS,
NOMAN


detail,
if a user send one print then viewer is open user take print out but not closed the viewer in the same time again user send the print then its not open its making problem becouse old viewer is already open , how to handle this situation please anyone can help on this urgent matter with thanks.
Love is Life & Life is Love!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.