4 Easy Steps to Creating Word Documents that Include ERP Data

Apr 8, 2014 12:00:00 AM

Four Easy Steps to Creating Word Documents that Include ERP Data

By using To-Increase Connectivity Studio to connect Microsoft Dynamics AX and Microsoft Word, you can easily create Word documents that include information from the ERP system. Today, I’ll show you how this works. The solution takes advantage of the rich Word capabilities, including layout options and styles, together with the efficient setup and power of Connectivity Studio to map your data model. You can define the integration with Microsoft Word in the same was as you define integrations for XML, EDI, Microsoft Excel, or text. You also have the option to generate documents based on conditions such as language, project phase, or project type.

Today’s usage scenario is especially common in architectural, engineering, construction, and professional services companies, where it is often necessary to generate contract documents that need to include data from Microsoft Dynamics AX as well as logos and pre-set text content. They usually involve standardized text fields, tables with lists of values, or header paragraphs. Usually, companies also want to personalize the documents, so they address a customer by name instead of “dear customer.”

The Basic Process

You can use Connectivity Studio to define how you want to publish Microsoft Word documents. To do this, you set up the source from Microsoft Dynamics AX and export it to Microsoft Word. One large advantage in this process is that you don’t need to have Microsoft Office installed on your server, because the documents are generated with Microsoft Office Open XML, an XML-based file format for documents, spreadsheets, and other files. You can potentially save substantial license fees as a result.

In Connectivity Studio, you combine the setup and template capabilities to control the layout of a Word document. In the following exercise, I take you through the sequence of exporting a sales order and generating a nice-looking Word document based on an existing template. In this template, you can add references, predefined texts, and logos. The process involves four simple steps:

1 - Create your template.
2 - Define which Microsoft Dynamics AX data you want to use.
3 - Define how you want to map the ERP data to Microsoft Word.
4 - Watch the result!

 

Create Your Template

In the template, we use sales order data. We create a header, a table for the sales lines, and some fixed text within that template. To begin with, you create a new document in Microsoft Word and save it as a template.

Word AX 1

In Connectivity Studio you then create a document to describe how the data should be mapped.

Word AX 2

For each record, you can define specific settings. You can show a record and use it to:

- Replace fields
- Show it as a paragraph
- Show it in a table

Again for each record, you can also specify the options. In the sample below you see that we show the sales order as a paragraph. The marker is [SalesOrder], and you can add it to the template.

Word AX 3

For the fields, you can also specify how they will appear in Microsoft Word. For example, you can define the location of the label, if it is a fixed or a language-specific label, or if you need a line break after each field in the paragraph.

Word AX 4

The sales line appears in a table. The table style can be selected from the template. This integration makes it very easy to set up and control the layout.

Word AX 5

Define Which Microsoft Dynamics AX Data You Want to Use

Your setup is now ready for Connectivity Studio. You still need to specify which data should be used for the sales order. In this sample, we only use data from the sales table and header. You only need to select the fields which are required for the Word document.

Word AX 6

Define How You Want to Map the ERP Data to Word

You have now defined the source and target. Next, you to define the mapping between the two data models. A message in Connectivity Studio links source and target.

Word AX 7

You can now map the data. In the mapping you can also use advanced options such as constant values, lookup values from other tables, and available display methods. In this sample, we map the sales table once for the paragraph and once for the specific fields.

Word AX 8

Watch the Result

Run the message for a sales order and check out the result:

Word AX 9

As you see in the screen shot, you can also run this task in a batch. Word documents can then be generated on a batch server, with very fast parallel processing.

Below, you see the fine result with data from Microsoft Dynamics AX.

Word AX 10

But there’s more! In addition to what you just saw, we support multiple languages. You can use the label IDs in the Word document and generate the template using the order language.

Word AX 11

You can also set up templates per language, which is the most commonly used condition. This capability is very useful when you use fixed texts in your document.

Word AX 12

As you see, this is a very efficient way to create high-quality Word documents that include ERP data. If you have questions or would like to know more about the process, please contact us .

Share this message
About Author
Pieter de Jong

Pieter de Jong

Business and Application Integration Specialist Pieter translates the business requirements of the industries and companies To-Increase serves into functionality in our Business Integration Solutions for Microsoft Dynamics AX. His specialized skills include model-driven development, Javascript, Java, HTML, XML, Visual Studio, and Eclipse. Before Pieter joined the team at To-Increase, he spent a career of close to 20 years as a software engineer and developer at Baan Info Systems and in other companies.

Get In Touch

Related Blogs

May 28, 2019 7:42:40 AM
Apr 9, 2019 9:27:11 AM
Dec 17, 2018 9:01:05 AM