Solution to overcome the message “Report processing was cancelled“ while rendering report in VS.NET report viewer control

This message will come if we have both the  SetDisplayMode() & RefreshReport() like below
ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
Me.ReportViewer1.RefreshReport();
The SetDisplayMode internally calls RefreshReport() and
at the same time as per the second statement above we also explicitly call the RefreshReport() hence the
previous call will gets cancelled hence the message “Report processing was cancelled”. The same applies if we call refreshReport() first and then SetDisplayMode()
To overcome this message, don’t call RefreshReport() when you have SetDisplayMode().

4 thoughts on “Solution to overcome the message “Report processing was cancelled“ while rendering report in VS.NET report viewer control

  1. Wow that was odd. I just wrote an extremely long comment but after I clicked submit my comment didn’t show up. Grrrr well I’m not writing all that over again. Anyway, just wanted to say superb blog! eccggbbaddeacecd

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s