Training
Module
Use Microsoft Word and Excel templates with Dataverse - Training
Explore how you can create data analysis and standardized documents by using Microsoft Dataverse data along with Microsoft Word and Excel templates.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Would you like to update the look and feel of your customer facing documents from the drab report writer formats?
Would you also like to email those documents directly out of Dynamics GP?
The Word Template functionality in Microsoft Dynamics GP is pretty awesome and it will do all of this as well as allow you to have separate document types for different companies and customers.
There are a few tricks to setting up and getting things functioning. It’s important to perform these steps in order.
You also will be working with the Template Configuration and Template Maintenance in Dynamics GP.
You must have two applications installed before beginning this process:
Open XML will be installed when you install Dynamics GP. The Dynamics GP Add-On for Word is located on the Dynamics DVD.
To use Microsoft Word with Dynamics GP, you must add the “Developer” tab to your ribbon bar. In Microsoft Word navigate to Options | Customize Ribbon and select “Popular Commands.” Add the Developer function to the Ribbon list and then check the box. Click “OK.”
Install
Using the Microsoft Dynamics GP installation media. Double click the setup.exe file.
Under Additional Products click on Microsoft Dynamics GP Add-in for Microsoft Word, then Install.
Click the radio button I accept the terms in the License Agreement, click Next.
Select the install location for the Microsoft Dynamics GP Add-in for Microsoft Word, click Install.
Note
The default location is C:\Program Files (x86)\ Microsoft Dynamics\ Report Templates\
Once the Microsoft Dynamics GP Add-in for Microsoft Word is installed, click Finish.
Open Microsoft Word, select the Developer Tab, verify that the Microsoft Dynamics GP Templates group shows.
Note
The Microsoft Dynamics GP Add-in for Microsoft Word is User Profile specific. Therefore, this add-in needs to be installed for each user that is going to be creating new Word templates and/or adding data sources and fields to existing Word templates.
Note
If you receive the following when you attempt to install the Add-in:
Setup has detected that the file 'C:\Users\AJRN-~1\AppData\Local\Temp\VSD23A2.tmp\VSTOR30\vstor30.exe' has changed since it was initially published See the setup log file located at 'C:\Users\AJRN-~1\AppData\Local\Temp\VSD23A2.tmp\install.log' for more information.
A quick tip to get around this type of error message is to install the referenced .exe files from the GP installation media, vstor30.exe.
If you are missing the Developer tab, right click in the black space within the ribbon > click "Customize the Ribbon" In the Word Options window check the Developer box, click OK.
The following settings in Microsoft Word will help you see the layout structure of the Word Template and make editing them easier. To open the Microsoft Word Options, click the File menu in Microsoft Word and select Options. Check the following options under the Display category:
Administration >> Reports >> Template Maintenance >> choose the Report Name drop-down list and select More Reports.
Template-enabled reports are Report Writer reports that have a Microsoft Word Template document associated with them. When enabled the option to print becomes available in the Report Destination window.
Note
If you receive an error message You must activate Word template functionality to send document when you try to email in Microsoft Dynamics GP
, make sure Word template functionality is enabled in the E-mail setup of the module you are trying to email from. For example, to enable Word template functionality for Sales, go to Tools > Setup > Sales > E-mails Settings for a Sales > SOP Word template.
Word Templates are based on the Standard report definition in Report Writer. Report definition is needed for:
Microsoft Word does not perform these actions; it simply displays the report that has been rendered.
The word template document defines the layout of a report.
It contains the report definition details such as sections in the report, fields in each section, and any static text values defined for the report. This information is gathered from the report definition, and then embedded into the word template when created.
When you choose Template as the Report Type, the assigned Microsoft Word document will be used to generate the output of the report.
The Word Template document is a standard Microsoft Word document. When rendered from Microsoft Dynamics GP, the additional information from the report definition is embedded into the document. Several tables in the word template document define the overall structure. All content that is displayed in the generated Microsoft Word document is placed inside these tables.
Note
Any text that is not within one of these tables will not be included in the generated word template.
Located after the Report Header table in the Microsoft Word document.
Corresponds to the Body content and any additional Headers and/or Footers.
Contains main content ‘guts’ of the report.
Has multiple rows.
One row for the actual report body, then an additional nested row for each additional header/footer.
(example: item description, line-item comments)
The fields, captions, and legends are the specific data points that link the word template to the report definition.
1.Click on the item within the word template document. The tag containing the name of the report definition field will be displayed. 2.Click on the tag to select it. 3.Remove the item by pressing the Delete or Backspace buttons.
The item properties will show what section of the report data the item originated from. To display the Content Control Properties, select by clicking the item in the word template. In the Developer tab, click Properties under the Controls group.
Note
The tag field in the Content Control Properties window indicates which section of the report definition the value is from.
A bookmark identifies and labels a specific section or location within a document that can be used to identify for future reference.
In Microsoft Dynamics GP there are 5 default bookmarks. These bookmarks are used in conjunction with the XML on the template to determine where on the Microsoft Word document your report information should be placed.
First, you will want to make sure that Bookmarks are visible on the document you are viewing.
In Microsoft Word, File menu, Options, Advanced tab, Show document content section.
Check the box next to option Show bookmarks.
Now that we know bookmarks icon is enabled and you can see them on the word template, you can use the following direction to see which bookmarks on your document.
Tip
Bookmarks appear as a grey capital I or roman numeral 1.
Open the Microsoft Dynamics GP Word Template via directly opening the .docx file or clicking Modify in Template Maintenance on the specific Word Template.
In Microsoft Word, click into any of the tables that contain data on the template, go to the Insert menu, Links section, select Bookmark.
Reference the following “map” of a report template document to see where the bookmarks are located.
Note
StartTemplateDocumentBookmark and EndTemplateDocumentBookmark are used only for calculating page numbers for report template document. They do not identify tables in the report template document.
To be found by the template processing engine in Microsoft Dynamics GP, these bookmarks must not be located within the fields, captions, or legends used for the report.
Word Templates that are generated via the Word Template generator may not necessarily have all these bookmarks. This varies based on what is included on the Report Writer report xml file used when generating a template.
Each company in Microsoft Dynamics GP can have an image assigned that is to be displayed on the Microsoft Word template reports. Assigned in the Image Assignment window (Administration >> Reports >> Template Configuration >> Images). Typically, this logo is placed in the Page Header table for the word template.
Create a cell to contain the image.
In the word template, create a table call in the location where you want the image to appear.
Add a Picture Content Control.
Display the Developer ribbon in Microsoft Word. In the Controls group, choose to insert a Picture Content Control.
Set the picture size.
Use the resize handles on the Picture Content Control to the size required for the word template document.
Set the picture properties.
With the Picture Content Control selected, click Properties in the Controls group. Set the following properties:
Property | Value |
---|---|
Title | CompanyLogo |
Tag | globals.’Company.Logo’ |
Note
You can opt to not have a Content Control field for the company logo and have the image directly on the template.
Open Report Template Maintenance. Administration >> Reports >> Template Maintenance
Select the template. In Report Template Maintenance, select the report template for which you want to make a rea-only version, click Modify.
In Microsoft Word, in the Review tab, click Protect, then Restrict Editing.
Save the changes made to the word template.
Close the modified report.
Import the modified word template document into GP. In the Report Template Maintenance window select the template you would like to import. Click Add Template (green plus) A file dialog box will appear. Select the word template document that you had just saved.
Replace the existing report template document. A message will be displayed that indicates you are replacing an existing template. Click Yes to replace the existing word template document with the one you have just modified.
Open Report Template Maintenance. Administration >> Reports >> Template Maintenance
Select the original version of the report.
Create a new report template document.
Specify the details of the new word template document.
In the New Template window, specify how the new report template document will be created. For reports that have no existing report template documents, the new report template will be blank (no layout). For reports that have existing report template documents, the new template can be created based on the template you select.
Supply a name for the word template you are creating, click Create.
Modify the new report template.
Save the new report template.
Note
Always check the box to Maintain compatibility with previous versions of Word before saving. Only available the first time the document is saved.
Close the new report template.
Import the new report template.
Replace the existing report template document.
Open Report Template Maintenance. Administration >> Reports >> Template Maintenance
Select the modified version of the report.
Create a new report template document.
Specify the details of the new word template document. In the New Template window, specify how the new report template document will be created. For reports that have no existing report template documents, the new report template will be blank (no layout). For reports that have existing report template documents, the new template can be created based on the template you select.
Supply a name for the word template you are creating, click Create.
Modify the new report template.
Display the field list for the report.
View the additional resources for the report.
Make modifications to the report template layout.
Save the new report template.
Note
Always check the box to Maintain compatibility with previous versions of Word before saving. Only available the first time the document is saved.
Close the new report template.
Import the new modified report template.
Replace the existing report template document.
Note
The status field in Template Maintenance correlates to the version of the report selected in Alternate/Modified Forms and Reports.
Update the modified report.
Update the Report Writer report in Report Writer.
Run the report for which you made modifications to.
Export the report in XML format.
In the Report Destination Window, export the report as a file in XML format, click OK.
Open the report template document.
This can be done by clicking Modify in the Report Template Maintenance window (Administration >> Reports >> Template Maintenance) or opening the report template document .docx file directly.
In the Developer pane, select Field List from Microsoft Dynamics GP Templates group.
Select the XML Resource containing the report definition in the Custom XML Mapping pane.
In the Developer pane, select Remove Source from the Microsoft Dynamics GP templates group.
Click OK to removing a data source may cause missing data on the template.
In the Developer pane, select Add Source from the Microsoft Dynamics GP Templates group.
Locate the XML Document file saved in Step 3 and click Open.
In the Custom XML Mapping pane, you should see a new XML Resource listed.
Note
The naming convention should be the same as before.
Modify the word template as needed and Save As.
Re-import the word template document into Microsoft Dynamics GP.
The Microsoft Dynamics GP Word Template Generator is a utility that can be used to help create a Word Template for Microsoft Dynamics GP reports.
Service Packs and Hotfixes for the Word Template Generator for Microsoft Dynamics GP | Microsoft Docs
In the Downloads section, select MDGP2013_WordTemplateGenerator_FullInstall_R2.zip
Click the radio button I accept the terms in the License Agreement, click Next.
Select the install location for the Microsoft Dynamics GP 2013 Word Template Generator Tool, click install
The default install location is C:\Program Files (x86)\Microsoft Dynamics\Template Generator\
Once the Word Template Generator Tool is installed click Finish
The following screen capture shows what the Template Generator tool looks once installed.
Run the report for which you want to create a template.
Export the report in XML format.
In the Report Destination Window, export the report as a file in XML format, click OK.
Drag-and-drop the XML file over the TemplateGenerator.exe file.
In the location where the XML file was originally saved, a DOCX file will be created with the same name.
Add the template into Microsoft Dynamics GP.
Test the template.
Revise the template as needed.
If you experience issues with the Word add-in, best to uninstall/reinstall.
Incorrect data in Word document
Template processing does not complete.
If you run a report, choose to generate the output in Microsoft Word format, but the processing never completes, try the following:
Be sure that the SQL Server Browser service is running on the machine. This service is necessary for template processing to complete successfully.
The Template Processing Engine may have encountered an error and be in an unknown condition. Restart Microsoft Dynamics GP so the Template Processing Engine is re-initialized.
Remove any non-typical controls that may have been added to the template layout. For example, templates cannot be processed if they contain the “Rich Text Control” that can be added from the Developer ribbon.
If a specific report is causing problems, try simplifying the report template document to isolate the problem. For example, if a modified report will not generate the output in Microsoft Word format, try running the original version of the report. If the original report can generate the output in Microsoft Word format, the issue can be isolated to changes you made in the modified report template document.
Add the following settings to the Dex.ini file:
KeepTemplateFiles=TRUE
TPELogging=TRUE
When you add these settings, a log file that has a name beginning with TemplateProcessing, as well as the intermediate template documents are stored in the current user’s temporary folder. To access the temporary folder, type the following in the Run command:
explorer %temp%
Sort the contents of the temporary folder by the modified date. Examine to files related to the report that will not process. They will contain information that can be helpful when troubleshooting.
Press and hold the Alt key when moving table boarders to prevent them from snapping to the grid in Microsoft Word.
Use the Design Mode which can be activated from the Developer tab to see quickly which sections the items in the word template comes from.
Make regular backup of your word template as you are working, in case you make a change that you’d like to revert.
Can you modify a pre-existing template and import without the error? If yes, it could be something with the file you are trying to import, see #7 below.
Open up the xml file that you generated with notepad. Look at the top of the xml.
If you see a line like the following in the dictionary node, then the xml has been generated on the original, not modified report:
<Main Path="C:\GP2018\">Dynamics.dic</Main>
If you see something like the following lines, it means that you generated the xml on a modified (in report writer) report.
<Main Path="C:\GP2018\">Dynamics.dic</Main>
<Report Path="C:\GP2018\Data\">REPORTS.DIC</Report>
The versions also have to match and if this is an alternate report then that could also cause a problem.
You will also want to check the xml name. It should be something like this: XMLNAME="SOP Blank Picking Ticket Order Entered" (example report)
Now you know the report name and whether it's modified or original, go into the Template Maintenance window and be sure to choose the report that matches the XMLNAME and either original/modified.
Rule out the Logo on the report and if that is causing an issue.
Make sure the form is set to compatibility. Always check the box to Maintain compatibility with previous versions of Word before saving. Only available the first time the document is saved.
Make sure the file is unlocked.
Verify the XML file is connected to the correct report format.
If you received this template package from an email, there is a chance the email security systems can potentially remove or block XML resources. Many email security filters scan attachments for potentially harmful content, including XML files, which can be flagged or removed if they are deemed suspicious or contain malicious code. Open the file and check the XML resource connected to the template, if it is missing, that will cause the error.
First, you need to determine what report we’re basing our template on and whether it’s an original report or a modified report.
Why?
Word Templates are based on the standard report writer report. In order to create and assign a template the system needs to know the name of the report and also whether the report is already modified.
Tip: We recommend always basing the template on a modified version of the report for greater flexibility in the future.
Why?
Remember that the template uses Report Writer to access data. If we ever want to add a new calculated field, we need to create it first in Report Writer for it to be available in our template, thus it’s a modified report.
Reports | Template Configuration
In Dynamics GP, the configuration window allows you to enable a specific form(s) to work as a template. Mark the document(s) for which you want to create a template. At the bottom of the window, be sure to mark the ‘Enable Report Templates’ and, if desired, to ‘Allow use of the Standard form’ even though you’re using the template.
We're sorry. We can't open ….docx because we found a problem with its contents.
Details: Unspecified error
Location: Part: /word/footer5.xml, Line:0, Column:0
Word found unreadable content in "….docx".
Do you want to recover the contents of this document?
If you trust the source of this document, click Yes.
This issue can also cause the e-mail to fail
In 2020 there was an Office security update that changed how XML files are read in Microsoft Word. Since Word Templates in Microsoft Dynamics GP rely on passing Report Writer fields to Microsoft Word via XML, this caused Word Templates to fail when printing with Unreadable Content errors. There is a history recorded on this issue in the following post.
Word Templates will not Email/Print after Office Update
Changes were made in Microsoft Dynamics GP to produce an XML file that conformed to this new Office update for security reasons.
We released this fixed in both GP 2016 and 18.3 on the 2020 Year End Update.
The 2020 U.S. Year-end Update has released and has the template fix for GP 2016 included
If you are not on versions 16.00.0814 and higher, OR 18.3.1200 and higher, you will continue to receive these errors when printing Word Templates and there is no workaround other than to upgrade to a version with the fix that is compatible with Microsoft Office’s security updates.
If you on a version higher than that that already has the fix, then I would make sure that your Office is up to date, and test changing your user security for the report and template to our default reports to verify whether it is an environmental issue or if it’s an issue with your modified reports/templates.
It is best practice to have back-up's created anytime you have a modified Word template (just like we do with customized forms and reports) in case it might get corrupted during an update. Once modifications have been completed, save the Word document. The default location where the file gets saved is C:\Users(current user)\AppData\Local\Temp. Modified Templates won’t print or email after upgrade to Microsoft Dynamics GP 18.6 - Stuck in Template Processing
This error can be cause by a few of things:
Failing to select "Maintain Compatibility with previous versions of Word" when initially saving the template or the file is corrupt and cannot be opened.
This error is normally encountered when trying to generate more than one template.
The user needs to make sure they always have this option checked when saving "Maintain compatibility with previous versions of Word"
Note
Word only gives you the option to mark Maintain Compatibility the first time you save the template, so you have to use the steps from this blog to re-enable it. https://community.dynamics.com/gp/b/dynamicsgp/archive/2012/03/13/error-message-when-printing-or-emailing-multiple-word-templates.aspx
Hyperlinks on the template can cause these errors.
Remove any hyperlinks on the template. The hyperlinks affect the XML file that GP uses to generate the final word template causing it to error.
Remove header and footer shading from the template, then see if the error persists.
Example: Image of dotted line to symbolize cutting statement to attach in mail.
Use boarders vs. embedded anchored image of line
If the above doesn't lead to a solution, it may be a corrupted field that will cause this, the error could say location header, as an example, so you would remove all header content controlled items and re-added them.
If your report is modified, try to print the original. Set Template to Default Original/Canned Report for Testing.
Please follow the steps below to test using the default (canned) template. This also involves switching your Report Writer security to the default report rather than Modified.
Note
If your user is assigned to an Alternate/Modified Forms and Report ID that is also used by other users, they will be affected by this change. Either create a new Alt/Mod ID, for your testing and assign it to your user, or make sure that other users in the system are not printing/emailing this report during your testing.
Error message One or more templates could not be processed. View the exception log for more details. This could mean there are XML Format errors for the template. If you have a back up of the template try to reimport it and see if this works.
Errors such as:
The usual cause of these errors in Dynamics GP template use is that 'Maintain Compatibility' mode was not selected when the Template was saved initially in Word. The reason that it would happen on the workstation but not the sever is usually because when Maintain Compatibility is not marked the Template will not be compatible with all versions of Microsoft Word. Most likely the versions of Word do not match between the server and the user's workstation.
Word only gives you the option to mark Maintain Compatibility the first time you save the template, you have to use the steps from this blog to re-enable it
If anything else changed with the upgrade, such as moved servers, a potential issue with your logo file and where it is located. If you are logged into GP and go to Report > Template Configuration, then click the Images button do you have path names specified for the company in question? Is that a valid path name?
Are you testing this directly on a new SQL Server? We have seen some issues where ports are closed or blocked between the GP client and the SQL Server.
These ports (TCP ports 1433 and 1434 and UDP port 1434) are used to populate the temp file(s) needed when generating a Word template report
Another item you can look at is the ODBC connection that is being used. If the server name is using an IP address instead of a server name it can cause issues with template processing.
There is a template processing DLL in the GP client folder that could potentially have a problem. I would recommend renaming your GP client folder (e.g. C:\Program Files (x86)\Microsoft Dynamics\GP), then go to Control Panel > Programs and Features and run a Repair against GP. This will lay down a new, clean GP client folder without any customization or 3rd parties. Launch GP from that install and try to repro the issue.
Try the process on a different machine or the server to see if it works. If it works on another machine, then reboot the non-working machine rebooted; it does not hurt to reboot the machine and try again.
The template processing also relies on the Dexterity Shared Components. You can you uninstall this from Programs and Features, then run the GP 18.6 installation media to reinstall it. It should see that it is missing and prompt you to include it via the bootstrapper.
Also in Programs and Features look for the Open XML SDK for Office. Dynamics GP will install version 2.0 of this as a prerequisite, but there is a version 2.5 out there. The problem is that when version 2.5 is installed the Word template and copy/paste functionality in GP will not work. If you see 2.5 installed you’ll want to remove that, let the GP install media bootstrapper install the correct version again, then test the printing process.
Note
In the Report Template Maintenance window, only reports that have a * in front of their name have a default template available in Microsoft Dynamics GP for printing. Any other report would require that the user creates their own from scratch or using template generator.
Word Templates are stored in the DYNAMICS database as a SQL Blob in the syReportTemplates table. They link the SY20000 table by the RELID and in this table you can see the actual name of the template that is stored as the blob. Templates are not stored in any folders on the machine.
select * from syReportTemplates where RELID = '9966'
select * from SY20000 where TemplateID = '9966'
The only way that a template would disappear would be if it was deleted from the DYNAMICS database or by the user in Dynamics GP.
System Administration Guide
Understanding the Lifecycle Policies for Dynamics GP
Training
Module
Use Microsoft Word and Excel templates with Dataverse - Training
Explore how you can create data analysis and standardized documents by using Microsoft Dataverse data along with Microsoft Word and Excel templates.
Documentation
Use and troubleshoot Report Writer - Dynamics GP
Provides information about how to use Report Writer and how to troubleshoot common problems in Report Writer.
A batch is held in the several statuses - Dynamics GP
Provides a solution to an error that occurs when you try to post a batch and open it in Microsoft Dynamics GP or in Microsoft Business Solutions - Great Plains.
Information about the Check Links process - Dynamics GP
Provides information about the Check Links process in Microsoft Dynamics GP.