Slow performance with SSRS ReportViewer control in WinForms application

Posted on 2007-10-12
Last Modified: 2013-11-07
I have a Windows Forms application that uses SQL Server 2005 Reporting Services and displays the reports in the application using the ReportViewer control. I'm having a significant performance problem. There seems to be a large performance cost to using the ReportViewer control. A report that displays in 30 seconds when run by navigating through the reports directory using IE takes 4 minutes when displayed using the ReportViewer control. Is there some way that I can cause the ReportViewer control to speed up its processing or at least to display the first page of the report as soon as it is available? This app is a port from an Access database and the Access reporting performance is so much better that I'm having customer satisfaction issues. Thanks.
Question by:Paracom_Inc

    Expert Comment

    I'm having the same performance issues with the Report Viewer for ASP.NET... any more info out there?
    LVL 9

    Accepted Solution

    Just a question:
    1. Did you tried to keep the report creation on the server (ProcessingMode=Remote)? This might be a reason because when you make it local all the source dataset is sent locally (reproduced from DB into a local DS), then the report is processed, and that may take quite a while, especially when the cusomer doesn't have a large bandwidth to communicate with the server.
    It's weird that IE responds faster that the windows app, they should be comparable. For IE the report is produced on the server, than is parsed into and HTML, the process is pretty the same for Reporting.WinForms.ReportViewer
    2. If your problem persists it might be something about your reports, there are some tricks there too. Instead of drilldowns (if any) you shoud create subreports, that will not grab the whole data (if your view is at group level as for drilldowns) but just the data you need. Some other trick is to pre-prepare the reports - if they are predictable (i.e. the passed month invoices) - and just show them when asked, not produce them each time.
    3. Another issue may be the authentification/authorization for the reports of the client that ask for them. The process of authentication/authorization to access a resource (report) may add a certain ammount of time. Try initially to take off all the auth's and see what's happening. If there's the extra time try to find some faster way of auth's.

    Author Comment

    Thanks for the suggestions.
    The reports are being processed remotely not locally, so that's not the issue. There is no drill down for the reports in question. And there is no special authentication/authorization in play either. The one shared feature of each of the slow reports is that they have a picture displayed in each row of the report. The pictures are displayed using a URL, they are not stored in the database. Only the URL is stored in the database. The reports have thousands of rows and therefore thousands of pictures to display. But, of course, this is true even when the report is displayed in IE, when it is not slow. Does this help?

    Expert Comment

    I'm having the same issues.  Most of the reports perform adequately although there has been a significant performance impact by using the ReportViewer - in the order of 12-13x.  We are using some beefy iron and a SQL-Server database.  Our longest running report takes about a second to run from the ReportManager (http://reportserver/reports/reportpath), but when I run it on the web page it takes about 13 seconds.  
    I've tried a few things to deal with the problem and found a couple of things:
    1 - The ReportViewer uses a lot of TCP ports to do anything.  When I started looking at the performance I saw up to 120 ports per report request (for the 13 second report).  Given that Windows' (by default) only allows for about 4000 ports, we end up with a significant limit on the number of users we can have.  Even when we upped the number of ports to 65K & reduced the recycle time to release ports back we continued to have the problem.  One thing I found to do to help resolve this issue was to write my own ReportServerConnect.  That seems to have reduced the number of ports and improved performance, but didn't eliminate the problem.
    2 - The ReportViewer apparently causes issues with the Viewstate.  I was getting viewstate errors if I tried to click quickly through my list of reports.  The ReportServerConnection manager along with a new base Page class (that makes Viewstates handled in a server-side array that I store in the session object) has eliminated the stability issue, but the performance issue continues.

    At this point I don't know where to look next.  If anyone has any ideas for performance improvements I'm happy to supply detailed code examples.  I'm using MS ReportViewer (their web.ui version) version 9.  

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    737 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

    23 Experts available now in Live!

    Get 1:1 Help Now