asp .net 4 C#: Problem making a hidden ReportViewer visible when clicking a button.

Posted on 2012-08-20
Last Modified: 2012-08-25
Using Visual Studio 2010, I have a web page with a working ReportViewer connected to a SQL DB. I now want to have that control hidden until a user clicks a button.

I have set the ReportViewer visible property to false, created a button, and have written in it's click event myReportViewer.visible = true;

Run it, but nothing happens when clicking the button. What else do I have to do to make the reportviewer visible and refresh it's data?
Question by:MyNameIsIvan
    LVL 10

    Expert Comment

    Does it appear that the event is being called when you click on the button, in other words can you see that the page refreshes?

    Accepted Solution

    Yes, the event is being reached because I also changed the text of the button which is successful when run.

    Nevertheless, I've found the solution myself...

    After making the ReportViewer visible in my button even, add these two lines:

    ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;

    The problem is due to a bug in the viewer which is explained well here (although he toggles it the wrong way around in his example):

    All works now, but thanks anyway!

    Author Closing Comment

    See my above comment

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now