ASP.NET ReportViewer is very slow in local mode

I am using .Net 4.5 and ReportViewer 11 in local mode. My reports are processed very slowly (10 min). I found in this post that adding <trust legacyCasModel="true" level="Full"/> to web.config would solve the problem, and this happened. The report rendering time lasted from 10 minutes to 10 seconds, but now my dynamic variables in other parts of the system do not work. This is mistake:

Dynamic operations can only be performed in a homogeneous AppDomain.

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

+4
source share
4 answers

Changing the .net structure to 3.5 will help you download your reports one and a half times. You can try in your case.

+1
source

The latest in this release 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 might be Addressed in SQL Server 2012.

If you are not using 4.5 specific functions, rolling back to 3.5 is the most feasible option. Since the cas setting is part of web.config, the option is not available for every page.

Consider creating a single page subpage for your report page, on which the sub-site is a separate application with application pool 3.5, it may cost a quick test.

+1
source

It may not be possible to set the trust level for only one page, but you can split the page with the ReportViewer control into a new web application and, therefore, into a new application domain. Therefore, changes to web.config only affect the report view page.

There are also some other advantages to this workaround, such as:

  • The ability to scale a reporting website in different ways, as it typically consumes a lot of resources.
  • the ability to disable session state for the main website for performance reasons and keep it enabled only in reports, because ReportViewer requires session state
0
source

Please use the following link for more information.

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

Add:

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

under: configuration / system.web from Webconfig. This helps improve report performance by 10 times. But the effects of dynamic objects in MVC projects.

0
source

Source: https://habr.com/ru/post/1501628/