Thursday, March 27, 2014

AX 2012 SSRS - Misc Problems and Solutions

Problem
You get a http 503 service unavailable during installation of Report Extensions.

Solution
Remove Report Server settings in AX.

Problem
Can't install Report Extensions. Error message:

"An error occurred during setup of Reporting Services extensions.
Reason: Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified."

Solution
Install Microsoft® SQL Server® 2008 R2 Shared Management Objects (SMO)

You need this as well to install SMO:
Microsoft® System CLR Types for SQL Server® 2008 R2 (required package for SMO)

See: http://blogs.msdn.com/b/axsupport/archive/2012/06/26/unable-to-deploy-ax-2012-reporting-extensions-on-sql-server-2012-reporting-server.aspx

Problem
The title of the window of a SSRS report doesn't change as expected when editing it on the menu item or from Visual Studio.

Solution
Delete usage data in AX.

Problem
Error while setting server report parameters. Error message: 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)

Solution
Open the file C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\rssrvpolicy.config
Set PermissionSetName to “FullTrust” at Name=Report_Expressions_Default_Permissions

See:
http://community.dynamics.com/product/ax/axtechnical/b/axsupport/archive/2012/02/02/microsoft-dynamics-ax-2012-reporting-extensions-error-system-security-permissions-environmentpermission-while-running-report.aspx

Problem
The reports are deployed to the wrong report folder.

Solution
AX was started with the wrong active client configuration. You need to set the client configuration to the AOS that you wish to deploy to, even though you are overriding it on the client shortcut. Don't forget to restart AX afterwards - the setting is cached when AX is started.

Problem
The report cannot be deployed because it couldn't find the network path.

Solution
Start Windows service "Remote Registry"
See: http://technet.microsoft.com/en-us/library/gg724094.aspx

Problem
Error when running SSRS in batch:
"System.InvalidCastException: Unable to cast object of type 'Microsoft.Dynamics.Ax.Xpp.DictMethod' to type 'Dynamics.Ax.Application.SysDictMethod'."

Solution
Change SysDictMethod to DictMethod on line 3 in:
\Classes\SrsReportRdpRdlWrapperContractInfo\buildMemberAndNestedObjectMap

Problem
Error while setting report parameters. Error message: An error has occurred during report processing. (rsProcessingAborted)

Solution
See: https://community.dynamics.com/ax/b/axsupport/archive/2013/03/12/cannot-be-processed-at-the-receiver-due-to-a-contractfilter-mismatch-at-the-endpointdispatcher.aspx

AX 2012 Error: An attempt has been made to use a data extension 'AXREPORTDATAPROVIDER'

If you get the following error message from SSRS:

"An attempt has been made to use a data extension 'AXREPORTDATAPROVIDER' that is either not registered for this report server or is not supported in this edition of Reporting Services. (rsDataExtensionNotFound)"

Then the solution would be to:
  1. Try reinstalling AX report extensions.
  2. If that doesn't work, try uninstalling report extensions, uninstalling SSRS, installing SSRS and finally installing report extensions again.
  3. If it still doesn't work, then you seemingly have to reinstall the entire SQL database.
Sometimes step 1 is enough, but I've seen a case where we couldn't get it to work until we completed step 3.

Let me know if you know a simpler solution. 

NB: the configuration files for SSRS were correct and didn't change after completing any of the above steps, so the source of the error is someplace else.

AX 2012: Running an AX query from C# data method in SSRS


  1. Create a new query in AX 2012 from the AOT.
  2. Open a SSRS report and create a new data method. 
  3. Replace the code with the following:
 [DataMethod(), PermissionSet(SecurityAction.Assert, Name = "FullTrust")]  
 public static string TestMethod()  
 {  
      IEnumerable dt = Microsoft.Dynamics.Framework.Reports.AxQuery.ExecuteQueryStream("SELECT * FROM EmplQuery");  
      IEnumerator e = dt.GetEnumerator();  
      if (e.MoveNext())  
           return e.Current.Field(1);  
      else  
           return "No results";  
 }  
Don't forget to rename the method to the one you created, replace "EmplQuery" with the name of your query, replace return type with your type and select the field that you want when returning. Let me know if you want an example of returning a specific field by its name.

Error: KB2390372v2 does not apply, or is blocked by another condition on your computer.

When installing AX 2012, sometimes you might get the following error when applying KB2390372v2 (required by setup). 

KB2390372v2 does not apply, or is blocked by another condition on your computer.

This can be solved by installing the most recent setup support files for AX 2012. Run the appropriate Cumulative Update (CU) setup. Yes, this can be done even when AX isn't installed yet.

Restart setup and it shouldn't need this hotfix anymore.

Danish translation of error for those searching:
KB2390372v2 kan ikke anvendes eller er blokeret af andre tilstande på computeren