Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

BOOST SAVEAS and SAVEASPDF REPORT PERFORMANCE with Dynamics 365 Business Central 14.x on-premises

(0) ShareShare
ReportReport
Posted on by

With report 14.x you might experience slow performance on report SAVEAS or SAVEASPDF with standard or custom layouts.

Within this version there are currently 2 parameters that needs to be tuned for high report performance

 

  1. CAS POLICY

It is warmly suggested to have explicitly set CAS Policy to true in the Microsoft.Dynamics.NAV.Server.exe.config file as it was in all versions before: add the key: 

<NetFx40_LegacySecurityPolicy enabled="true"/>

Below an example

pastedimage1605710994894v1.png

To know more about this parameter there are 2 interesting blog that would highlight its benefit:

https://cloudblogs.microsoft.com/dynamics365/no-audience/2019/05/15/rdlc-report-performance-enhancements-in-dynamics-365-business-central/

https://cloudblogs.microsoft.com/dynamics365/no-audience/2016/05/20/rdlc-report-and-performance-in-microsoft-dynamics-nav-2015-and-2016/

In these blog, it is dissected and explained how CAS Policy influences performance and memory leaks.

Keeping a long story short

  1. From NAV 2013 onwards, CAS Policy has always been explicitly set to true to guarantee good performance on report execution.
  2. Starting from 14.x – remember that this was first a SaaS version up until CU 5 -, Dynamics.NAV.Server.exe.config file does not add explicitly CAS Policy parameter. This is typical with Sandboxes where CAS Policy must be disabled (set to false) to enable extension debugging through Visual Studio Code. 

In production environments, it is warmly recommended to enabled it (set to true) to guarantee optimal performance. 

Point b. is tightly related on Sandbox creation on the fly through Docker containers using DVD artifcats.

 

  1. MEMORY APP DOMAIN ISOLATION

Within RDLC report, you can use a code section to inject and execute VB.NET code (e.g. sedata, getdata, blanknumber, etc.). VB.NET code might open to potential security vulnerabilities that might expose memory to be dumped if not isolated.

That is why, within SaaS, all reports that do have a custom counterpart are using an isolated memory app domain, even though this might have an impact on report performance.

Considering On-Premises, since these are for their own nature self-protected – partners are taking care of development, data protection and security – there is not the real need (as it wasn’t for all past versions) to have report running in isolated app-domain, overall if they are running in single tenant (aka legacy) database mode.

This is also mentioned in the first blog listed before and memory app domain isolation could be (should be) disabled in the CustomSettings.config files as per the following

<add key="ReportAppDomainIsolation" value="false" />

ReportAppDomainIsolation parameter has been implemented since Dynamics NAV 2017.

 

Now a bit of automation with PowerShell.

If you have already automated your deployment procedure through PowerShell scripts, you could setup CAS Policy settings by parsing the exe config file through XML classes in the following way (Dynamics 365 Business Central Services must be in a stopped state) :

 

$serverExeConfigPath = 'C:\Program Files\Microsoft Dynamics 365 Business Central\140\Service\Microsoft.Dynamics.Nav.Server.exe.config'

 

[xml]$XmlDocument = Get-Content -Path $serverExeConfigPath 

$nodeExists = $XmlDocument.configuration.runtime.SelectSingleNode("./NetFx40_LegacySecurityPolicy")

if ($NodeExists -eq $null) {

   $netfxNode = $XmlDocument.CreateElement('NetFx40_LegacySecurityPolicy')

   $XmlDocument.configuration.runtime.AppendChild($netfxNode) | Out-Null

   $realNetFxNode = $XmlDocument.configuration.runtime.SelectSingleNode("./NetFx40_LegacySecurityPolicy")

   $realNetFxNode.SetAttribute("enabled","true")

   $XmlDocument.Save($serverExeConfigPath)

   write-host "NetFx40_LegacySecurityPolicy switch added and set to true"

}

else {

   write-host "NetFx40_LegacySecurityPolicy was already set"

}

 

Setting ReportAppDomainIsolation is even easier since you might use PS cmdlet from the Dynamics 365 Business Central Administration Shell (remember to restart the service afterwards):

Import-Module 'C:\Program Files\Microsoft Dynamics 365 Business Central\140\Service\NavAdminTool.ps1'

Set-NavServerConfiguration BC170 -KeyName "ReportAppDomainIsolation" -KeyValue false

 

Below how it should looks like in the admin console

 pastedimage1605711139172v2.png

  • Andy Sather Profile Picture
    on at
    RE: BOOST SAVEAS and SAVEASPDF REPORT PERFORMANCE with Dynamics 365 Business Central 14.x on-premises

    Thank you Duilio

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans