c# WinForms ReportViewer Performance issue using RefreshReport() and ServerReport.SetParameters()

Posted by mdk on Stack Overflow See other posts from Stack Overflow or by mdk
Published on 2010-02-16T16:15:05Z Indexed on 2010/03/18 0:11 UTC
Read the original article Hit count: 1427

Filed under:
|
|

Hi All,

Currently I am writing a c# client application that uses the WinForms ReportViewer Control to display reports from a remote server.

I am having performance troubles with the ReportViewer Control, to be specific with the 2 methods reportViewer.ServerReport.SetParameters() and reportViewer.RefreshReport() – they both take a really long time to complete and not just on the very first call, but on each subsequent call as well. SetParameters() takes 20 to 40 seconds (they vary greatly in time, some execute event okay fast) and RefreshReport() is a bit faster but still takes ages.

I don’t think the server is the culprit, as the same report viewed using the browser renders pretty fast, about a second tops.

The report in question doesn't matter as well.

When I break into the process and take a look at the call stack, I see a call to Socket.DoConnect.
So I thought that’s a good reason to start using fiddler and I installed it, disabled caching and fired up the app again to see which call takes that long to connect, but the performance issue was gone. By using a proxy I am having the same performance as the webbrowser.

FYI: I am using NTLM authentication in the following way: reportViewer.ServerReport.ReportServerCredentials.NetworkCredentials = new NetworkCredentials() { Username = ... }

I don’t have a strong webbackground, so I guess my question is: What should this tell me / What should I be looking into? (Btw: Adding fiddler to my installation package is not the solution I am looking for :))

I am grateful for any pointers.

Take care,
-Martin

© Stack Overflow or respective owner

Related posts about c#

Related posts about reportviewer