Saturday, April 26, 2014

Upgrade SSRS reports from Dynamics AX 2012 to AX 2012 R2

Sometime upgrade from Dynamics AX 2012 to AX 2012 R2 is really painful specially when we have huge customization on existing object related to EP, SSRS reports and of course Forms. I got following error when i tried to deploy some modified report which upgrade to R2:

Error      Message (12:17:24 pm) An error occurred while deploying the report ProjListTransProj. 
This might be because the SQL Server Reporting Services extensions have not been installed on the report server, or configuration information has not been entered in the Report Servers form in Microsoft Dynamics AX.

Error      Message (12:17:24 pm) System.Web.Services.Protocols.SoapException: Error while loading code module: ‘Microsoft.Dynamics.Framework.Metadata.AX, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’. Details: Could not load file or assembly 'Microsoft.Dynamics.Framework.Metadata.AX, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
   at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, Warning[]& Warnings)
   at Microsoft.ReportingServices.WebServer.ReportingService2005.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, Warning[]& Warnings)

Info        Message (12:17:24 pm) Report name: ProjListTransProj
Design names: ProjListTransProj.Report
Deployment status for design names: Error
Assembly names: ProjListTransProjReport.BusinessLogic.dll, DrillThroughCommon.dll
Deployment status for assembly names: Success, Success

One solution if this error is to open respective VS report project in VS environment and build it and deploy it. But in some cases its not working. 
so the other workaround is to hack the code, you should export the report which throw above error, and open the XPO in notepad and search the tag 6.0.0.0 and replace it with 6.2.0.0. You should also search tag "6.0.14.0" and replace it with "6.0.15.0".
Here is the sample:
#
#    Microsoft.Dynamics.Framework.Reports, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
#    Microsoft.Dynamics.Framework.Metadata.AX, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

to replace with:

#
#    Microsoft.Dynamics.Framework.Reports, Version=6.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
#    Microsoft.Dynamics.Framework.Metadata.AX, Version=6.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Happy Daxing

No comments: