Thursday, September 16, 2010

ReportViewer Control DLLs

Recently I was working on adding a ReportViewer control to our website to display reports created in ReportingServices 2008. We had created a custom error page for any errors that are unhandled by the application so our customers would not see the more serious and angry looking "Server Error" page when an error occured ..After the application was promoted to our web server, it started showing an error related to the CustomeErrors tag in the web.config file being not set appropriately. I had this flag set to "On" so the CustomErrors page would show instead of the Server Error page, but the application continued to display the "Server Error" kind of page..I had my mentor/coach/supervisor Wes take a look at this and he suggested that it seemed like it was a website-wide error, which the custom error handling functionality could not trap. He set the CustomErrors Mode flag to "off" and then ran the application. Now the application showed that the error had to do with the ReportViewer control which could not be recognized by the source code.

Solution - I had referenced the two ReportViewer DLLs in the Bin folder of my WebSite. He suggested to actually copy them into the Bin folder instead of just referencing them and after this the application worked just fine. (We put the CustomErrors mode flag to "On" at this point).

Conclusion -- Sometimes just "Referencing" DLLs in the Bin folder is not enough for the source code to identify the new component/control we are using. And secondly, I learnt that even though we may place CustomError handling on our website, there may be system-wide errors that this error handling will not be able to catch.

The two ReportViewer DLLs were : Microsoft.ReportViewer.Common.dll and Microsoft.ReportViewer.WebForms.dll. We were using version 10.0 of these Dlls.


A new update on the ReportViewer control version 10.0.0 -- When a ReportViewer control is placed on an aspx page with other controls on it, it causes JavaScript errors, especially when viewed in Internet Explorer. In order to avoid these errors, the ReportViewer control should be placed on a page by itself with no other controls on it.

No comments:

Post a Comment