Click here to Skip to main content
Click here to Skip to main content

Multiple Reports with a single Report Viewer Control

By , 17 Jun 2008
 

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)

About the Author

Gurpreet111
Software Developer Tarkia
India India
Member
He works on c#.net with TARKIA

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionMy vote of 0 (that's a ZERO)memberVBForever2 Mar '12 - 12:24 
Delete this crap. The article shows the addition of one report to a reportviewer control. Not "2".
 
What a maroon. Take those underpants off your head, too.
AnswerRe: My vote of 0 (that's a ZERO)memberGeoff Gariepy31 May '12 - 5:50 
You, sir, should be ashamed of yourself.
 
I can't believe Chris would allow this racist garbage on his site.
AnswerRe: My vote of 0 (that's a ZERO)memberGurpreet11127 Aug '12 - 17:25 
LOL.. This code will not work for you. Coz your focus is on my TURBAN not on the code.
And I cant help you in this... Smile | :)
Gurpreet Singh

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

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 17 Jun 2008
Article Copyright 2008 by Gurpreet111
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid