ASP.NET ReportViewer very slow in local mode
Asked Answered
U

4

7

I'm using .Net 4.5 and ReportViewer 11 in local mode. My reports are rendered very slowly (10 min). I found in this post that adding <trust legacyCasModel="true" level="Full"/> to web.config will solve the problem, and it did. Report render time went from 10 minutes to 10 seconds, but now my dynamic variables in other parts of the system don't work. This is the error:

Dynamic operations can only be performed in homogenous AppDomain.

Is there a way to set <trust legacyCasModel="true" level="Full"/> or something with the same effect in only one page?

Unmindful answered 11/9, 2013 at 9:42 Comment(0)
A
2

Please use following link for more information

https://codeontime.com/blog/2014/08/improving-performance-of-reports-in

Add:

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

in Section: configuration/system.web of Webconfig. It helps to Improve report Performance by 10 Times. But effects dynamic objects in MVC projects.

Anjanetteanjela answered 10/8, 2017 at 18:24 Comment(0)
U
1

Changing the .net framework to 3.5 will help you load your reports in half a time. You can give a try in your case.

Unpen answered 22/11, 2013 at 6:23 Comment(1)
Yes I know but then you're loosing the benefits of .net 4.5Unmindful
A
1

The latest in this issue can be found here https://connect.microsoft.com/VisualStudio/feedback/details/561679/reporting-services-using-parameter-for-dynamic-grouping-very-slow and it looks like it may be addressed in sql server 2012.

If you are not using 4.5 specific features rollback to 3.5 is the most feasible option. Since the cas setting is part of the web.config the option is not available on a per page basis

Consider building a one page sub site for your report page where the sub site is a separate application with a 3.5 app pool, might be worth a quick test

Argeliaargent answered 27/11, 2013 at 6:31 Comment(1)
I am using sql 2012. I've tried creating a separate 3.5 website for viewing reports but the extra work for maintaining two sites and all the duplicate code wasn't worth it.Unmindful
A
0

It may not be possible to set trust level for one page only, however you could separate the page with ReportViewer control to new web application and thus new application domain. This way the web.config changes only affect report viewer page.

This workaround also has some other benefits like:

  • ability to scale reporting web site differently as it usually consumes lot of resources
  • ability to turn session state off for main website for performance reasons and keep it turned on only in reporting as ReportViewer requires session state
Alver answered 22/9, 2015 at 13:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.