[SSRS] SSRS Report error DefaultValue expression AX_CompanyName

On many Dynamics AX installations the following error pops up when opening a ssrs report for the first time (maybe just once or more often):

The DefaultValue expression for the report parameter ‘AX_CompanyName’ contains an error: Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed. (rsRuntimeErrorInExpression)

The error seems to occur mostly with Reporting Services that have been configured to use a Microsoft Dynamics AX configuration file (located on the server where ssrs is running under C:\Program Files\Microsoft SQL Server\MSRS11.INSTANCE_NAME\Reporting Services\ReportServer\bin\Microsoft.Dynamics.AX.ReportConfiguration.axc).

To get rid of this error, simply change the PermissionSetName in the rssrvpolicy.config file (C:\Program Files\Microsoft SQL Server\MSRS11.INSTANCE_NAME\Reporting Services\ReportServer\rssrvpolicy.config):
Standard:

<CodeGroup
                    class="UnionCodeGroup"
                    version="1"
                    PermissionSetName="Execution"
                    Name="Report_Expressions_Default_Permissions"
                    Description="This code group grants default permissions for code in report expressions and Code element. ">
              <IMembershipCondition
                      class="StrongNameMembershipCondition"
                      version="1"
                      PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100512C8E872E28569E733BCB123794DAB55111A0570B3B3D4DE3794153DEA5EFB7C3FEA9F2D8236CFF320C4FD0EAD5F677880BF6C181F296C751C5F6E65B04D3834C02F792FEE0FE452915D44AFE74A0C27E0D8E4B8D04EC52A8E281E01FF47E7D694E6C7275A09AFCBFD8CC82705A06B20FD6EF61EBBA6873E29C8C0F2CAEDDA2"/></CodeGroup>

New:

<CodeGroup
                    class="UnionCodeGroup"
                    version="1"
                    PermissionSetName="FullTrust"
                    Name="Report_Expressions_Default_Permissions"
                    Description="This code group grants default permissions for code in report expressions and Code element. ">
                    ...

Repeat for every instance with this error.

Robin

Software Engineer / Application Developer

Subscribe to robsCode

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!