Often, the customer asked to modify the layout of the Standard reports to meet existing templates or tastes. and as we all know that changing the layout in the SSRS reports will take long time. Instead we can use one of the Dynamics AX functionality to export the customer data to MS Word Template in simple way and short time.  

The Document management functionality in Microsoft Dynamics AX give you the ability to attach files to records. For example, you can attach PDF, Microsoft Word, or Microsoft Excel files to a purchase order or a sales order. You can also create Word and Excel templates from Microsoft Dynamics AX data. 
This Article will discuss how to use MS Word templates rather than customize the standard SSRS reports in Dynamics AX 2012. 

In the following sections we will discuss how to export data from Microsoft Dynamics AX Sales order to MS Word templates.

This article divided into three parts.
  • Prerequisites (Step by step with screenshots )
  • Setup (Step by step with screenshots )
  • Implementation (Step by step with screenshots )
Create Sales Order Template by following these steps:
  1. Open new Microsoft word document ( I use Office 2010)
  2. design the Sales Order layout (Add company logo, Report header,report label).To simplify the subject I will add a few labels as follow:
  • Sales Order
  • Customer Account
  • Shipping Date
  • Delivery Date
  • Item Code
  • Description
  • Qty
  • Unit Price
  • Add Bookmark to each Label ( Bookmarks will be used to map the sales order fields to the Word template )
  1. But the courser after the sales order label 
  2. Go to Insert TAB and click the Bookmark Button 
  3. write the new bookmark name and click the add button
  4. Repeat the steps from 1 to 2 with all Labels
  5. Save the word file as Word Template
  1. Go to Organization Administration > Setup > Document Management > Document Management Parameter
  2. Click the number sequence Tab > Assign  number sequence to the Document file counter
  3. Click the File types Tab > Click Add Button > Add the Microsoft word template file type if not exist and close the screen
  4. Go to Organization Administration > Setup > Document types
  5. Click new and follow the steps in the following screenshot to add new document type
  6. Click the Option Button
  7. from the Table drop down list select the "SalesTable"
  8. in the template file field click the folder icon and select the Sales order template that we create before
  9. Go to the Field Tab
  10. in the data field select the "SalesId"(this field contain the Sales Order Number/Code)
  11. in the bookmark field write the bookmark name Which corresponds to "SalesId" in this case write "SalesOrder"
  12. repeat steps from 10 to 11 with all fields that you want to export and link it to the  corresponds bookmark( make sure to select the "SalesLine" table in the Data Table Filed before mapping the Sales Order line filed to the  corresponds  Bookmark see the orange rectangle)

  1. Go to > Account Receivable >Common Sales Order > All Sales Orders
  2. Select any Sales Order and Click the Attachment Button
  3. Click the New Button and Select the SOT
  4. the System will start the export process
  5. New document will be created and the Sales Order Data will be populated  automatically.
  6. that's all. Cool :)

To get new posts and updates, please follow the blog by clicking the Join this site Button in the top-right side under my personal information

See Also
  1. Export Purchase Order Data to MS Excel template with Dynamics AX 2012 ( Document Management )