Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinForms ReportViewer: slow initial rendering

UPDATE 2.4.2010 Yeah, this is an old question but I thought I would give an update. So, I'm working with the ReportViewer again and it's still rendering slowly on the initial load. The only difference is that the SQL database is on the reporting server.


UPDATE 3.16.2009

I have done profiling and it's not the SQL that is making the ReportViewer render slowly on the first call. On the first call, the ReportViewer control locks up the UI thread and makes the program unresponsive. After about 5 seconds the ReportViewer will unlock the UI thread and display "Report is being generated" and then finally show the report. I know 5 seconds is not much but this shouldn't be happening. My coworker does the same thing in a program of his and the ReportViewer immediately displays the "Report is being generated" upon any request.

The only difference is that the reporting server is on one server and the data is on another server. However, when I am developing the reports within SSRS, there is no delay.


UPDATE

I have noticed that only the first load of the ReportViewer takes a long time; each subsequent load of the same or different reports loads fast.


I have a WinForms ReportViewer that I'm using in Remote processing mode that can take up to 30 seconds to render when the ReportViewer.RefreshReport() method is called. However, the report itself runs fast.

This is the code to setup my ReportViewer:

rvReport.ProcessingMode = ProcessingMode.Remote
rvReport.ShowParameterPrompts = False
rvReport.ServerReport.ReportServerUrl = New Uri(_reportServerURL)
rvReport.ServerReport.ReportPath = _reportPath

This is where the ReportViewer can take up to 30 seconds to render:

rvReport.RefreshReport()
like image 297
Bryan Roth Avatar asked Jan 09 '09 21:01

Bryan Roth


2 Answers

I found the answer on other forums. MSDN explains that a DLL is searching for some Verisign web server and it takes forever... there are 2 ways to turn it off, one is a checkbox in internet explorer and another is adding some lines to the app.config file of the app.

like image 95
Eric G Avatar answered Oct 16 '22 06:10

Eric G


You can pull a report in two modes, local and server. If you're running in local mode, it's going to pull both the data and the report definition onto your machine, then render them both. In server mode, it's going to just let SSRS do all the work, then pull back the information to render.

If you're using local mode, it could be a hardware issue. If you've got a huge dataset, that's a lot of data to store in memory.

Other than that, that's not a lot of info to go on...

Update: since you've noticed it's only the first call that takes a while, have you done any profiling to determine if the bulk of the work is done on the backend SQL calls or is spent in the actual report render?

If it's faster on subsequent calls, it's possible you're (incidentally) caching at one level or another. You can cache reports (http://www.sqlservercurry.com/2007/12/configure-report-to-be-cached-ssrs-2005.html) or it could be that the execution plan to return the data is being cached deep in SQL Server.

like image 41
joshua.ewer Avatar answered Oct 16 '22 07:10

joshua.ewer