Click here to Skip to main content
15,868,016 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

 
QuestionMultiple reports into a single one Pin
ASHISH JUYAL15-Mar-16 20:50
ASHISH JUYAL15-Mar-16 20:50 
QuestionMy Vote is 5 Pin
Ashraf ELHakim23-Nov-15 13:56
Ashraf ELHakim23-Nov-15 13:56 
Questionerror is comming Pin
Member 1103596912-Nov-14 1:16
Member 1103596912-Nov-14 1:16 
Bugmy vote of 1 Pin
sebbod12-Sep-14 4:08
sebbod12-Sep-14 4:08 
QuestionUseless code :( Pin
Hameed Tajik29-Apr-14 3:17
professionalHameed Tajik29-Apr-14 3:17 
QuestionMultiple Reports Pin
aakhan31422-Aug-13 19:15
aakhan31422-Aug-13 19:15 
QuestionRefresh? Pin
Member 22751341-Aug-13 9:29
Member 22751341-Aug-13 9:29 
QuestionThanks. Just what I needed Pin
Member 22751341-Aug-13 9:15
Member 22751341-Aug-13 9:15 
GeneralMy vote of 5 Pin
Wakabajashij30-Jul-13 23:44
Wakabajashij30-Jul-13 23:44 
GeneralMy vote of 3 Pin
ABDUL QADER FAROOQI14-Feb-13 22:41
ABDUL QADER FAROOQI14-Feb-13 22:41 
GeneralMy vote of 1 Pin
SeriketZu6-Dec-12 17:01
SeriketZu6-Dec-12 17:01 
QuestionMy vote of 0 (that's a ZERO) Pin
VBForever2-Mar-12 12:24
VBForever2-Mar-12 12:24 
AnswerRe: My vote of 0 (that's a ZERO) Pin
Geoff Gariepy31-May-12 5:50
Geoff Gariepy31-May-12 5:50 
AnswerRe: My vote of 0 (that's a ZERO) Pin
Gurpreet11127-Aug-12 17:25
Gurpreet11127-Aug-12 17:25 
QuestionHOW TO OPEN MULTIPLE CRYSTAL REPORT VIEWER AT THE SAME TIME? Pin
nomi9-Feb-12 21:30
nomi9-Feb-12 21:30 
GeneralMy vote of 1 Pin
rizalmora3-Aug-11 21:44
rizalmora3-Aug-11 21:44 
Generaluse of multiple reports.rdlc files into a single reportviewer. Pin
Honey Jagyasi12-Apr-11 23:55
Honey Jagyasi12-Apr-11 23:55 
GeneralHelped me Pin
Maultier4-Mar-11 2:53
Maultier4-Mar-11 2:53 
GeneralMy vote of 1 Pin
Member 206038117-Feb-11 4:45
Member 206038117-Feb-11 4:45 
GeneralMutiple Reports in Single ReportViewer Pin
Member 83070526-Jan-09 17:58
Member 83070526-Jan-09 17:58 
GeneralRe: Mutiple Reports in Single ReportViewer Pin
Gurpreet11116-Feb-09 19:26
Gurpreet11116-Feb-09 19:26 
QuestionCan we subscribe the server side report through code? Pin
Prashant.IGT14-Dec-08 23:20
Prashant.IGT14-Dec-08 23:20 
Questionhow to show multipal reports on reportviewer at a time Pin
shashank2107714-Oct-08 21:21
shashank2107714-Oct-08 21:21 
GeneralProblem [modified] Pin
TheCrow754-Sep-08 5:12
TheCrow754-Sep-08 5:12 
QuestionHow do Pin
vb_buddy7-Aug-08 2:03
vb_buddy7-Aug-08 2:03 

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.