Tuesday, 28 May 2013

Exporting Reports with Report Viewer 2012

There is a known bug in the Report Viewer 11 component which results in the export of some reports either timing out or taking exponentially longer to complete than previously, especially with large datasets. This is due to Code Access Security (CAS) changes implemented in ASP.net 4. It does not seem as if Microsoft is releasing a fix for it but fortunately there is a work-around. It mostly affects reports using Groupings so one option is to rewrite these to use other report controls. This is not ideal so you can also add the following to the <system.web> your web.config file if you experience this issue.

<trust legacyCasModel="true" level="Full"/>

This reverts the CAS level to ASP.net 3.5. Since we have added all the dll's and 'trust them' this shouldn't have an effect on anything else in Stadium. We have run the build with this change through the automated tests and everything passes.

Additionally, if you are still running Report Server 2005, you cannot view remote reports with Report Viewer 2012. Microsoft only extended backwards compatibility to Reporting Services 2008. If you are affected by this and have no plan to upgrade to a newer version of SQL soon let me know so I can assess the impact and see what can be done to accommodate you.