Friday 14 October 2011

How to deploy all AX2012 report

There're 3 different ways to deploy Dynamics AX2012 reports:
  1. Through AOT
    AOT > SSRS Reports > Reports > right click on report > Deploy Element
     
  2. Through Visual Studio
    Open the report project > Right click on the project or solution node > Deploy
     
  3. Through PowerShell
    Publish-AXReport -ReportName *


Through AOT
- Go to AOT > SSRS Reports > Reports > (right click on report) > Deploy Element
- Right click on the report node
- Click "Deploy Element"
Deploy AX2012 report through AOT

Through Visual Studio
- Open the report project
- Right click on the project or solution node
- Click "Deploy"
Deploy AX2012 report through Visual Studio


Through PowerShell
- Go to: Start > Administrative Tools > Microsoft Dynamics AX 2012 Management Shell
- Then enter Publish-AXReport -ReportName *

This will deploy all AX2012 reports into report server, you might want to do this after the initial installation as the report server doesn't have all the report there yet. It takes about 20 minutes for me to deploy all the reports (that's on my Hyper-V image, if run on better spec server, it could be much faster).

If you want to deploy a specific report, just replace the wildcard (*) with the report name.
Eg. Publish-AXReport -ReportName SalesInvoice

*It is the report name under AOT > SSRS Reports > Reports > SalesInvoice, not the project name under AOT > Visual Studio Projects > Dynamics AX Projects > SalesInvoiceReport

Publish-AXReport -ReportName * will deploy all report (use wildcard to deploy full set of report)

Report deployment in progress

Report deployment in progress

Report deployment in progress

Report deployment completed

Report name should be the name under AOT > SSRS Reports > Reports > SalesInvoice,
not the project name under AOT > Visual Studio Projects > Dynamics AX Projects > SalesInvoiceReport

10 comments:

  1. Good post!

    Also, you can use the wildcard as part of the name when deploying a set of reports.

    Example of deploying all reports starting with PSA:
    Publish-AXReport -ReportName PSA*

    ReplyDelete
  2. Hi, i cannot deploy all reports using powershell:
    Publish-AXReport -ReportName *
    i got an error:
    ...
    Publish-AXReport : A call to the Microsoft Dynamics AX SRSFrameworkService
    service failed. An existing connection was forcibly closed by the remote host.
    At line:1 char:1
    + Publish-AXReport -ReportName *
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OpenError: (Microsoft.Dynam...shReportCommand:Pu
    blishReportCommand) [Publish-AXReport], ReportException
    + FullyQualifiedErrorId : A call to the Microsoft Dynamics AX SRSFramework
    Service service failed. An existing connection was forcibly closed by the
    remote host.,Microsoft.Dynamics.AX.Framework.Management.Reports.PublishRep
    ortCommand
    ....

    but i can deploy a single report by its name only, not all at the same command!!

    please help

    ReplyDelete
    Replies
    1. Try:
      Publish-AXReport -ReportName A*
      Publish-AXReport -ReportName B*
      Publish-AXReport -ReportName C*
      Publish-AXReport -ReportName D*
      .... (and so on)

      It could be one or more of the reports is having issue.
      You might need to deploy group by group to identify which report is causing error.

      Delete
    2. foreach ($letter in 97..122) {
      Publish-AXReport -ReportName "$([char]$letter)*"
      }

      Delete
  3. Hi,
    Can we call the 'Pulish Reports' from a script instead of ' Go to: Start > Administrative Tools > Microsoft Dynamics AX 2012 Management Shell'? And then 'Publish-AXReport'.
    I am trying to call the shell from a script to automate the 'Reports' deployment.

    Thanks,

    ReplyDelete
  4. Thanks, Esko! I got the same error reported by Mossa on one system only. You script works great though!

    ReplyDelete
  5. Thanx for the post

    ReplyDelete
  6. Thanks a lot ! It resolved my issue.

    ReplyDelete