Software, Implementation, Training & Support.
One monthly fee.

Build Your Subscription

What do cookies, Bronze Age swords, and websites have in common?

They’re all made with templates. And now NAV documents can be added to that fun list! Introducing one of the most empowering features of Microsoft Dynamics NAV 2015: the ability to create and use your own Microsoft Word templates with zero programming required. In this post, I’ll walk through how to modify and create new templates using Jet Express for Word.

 

Backing up: Why is Jet Express for Word so great?

Out of the box, NAV has some minimal document templates baked into the software for quotes, orders, invoices, etc. They generally look like this:

 

The built-in RDLC Purchase Order document
 
Yeah. Not the most captivating document, is it? With past versions of Dynamics, as a client you would have to call up your Microsoft partner and pay them to either change or build these documents for you. A standard set of these reports that the vast majority of clients need cosmetically and functionally tweaked are:
• Sales Quotes
• Sales Orders
• Sales Invoices
• Purchase Quotes
• Purchase Orders
• Purchase Invoices
• Customer Statements (Balance to Date)
And that’s just scratching the surface! It can take an entire day or more to build each of these reports for the native client. This new feature in NAV 2015 empowers you with complete control over your document templates and that with minimal effort, so that when you click to print/export that document, your end result will be a rich and highly customized document like you see below: 
 

 

Lots of customized gradients/table elements.

 

 

 

So, let’s get right into it, shall we? This post will discuss how to:

a) Modify and tweak the Jet Express for Word templates;

b) Create a template from scratch, using two methods (“Direct Edit” and “XML Part”);

 

Note: This article assumes you’ve downloaded and installed Jet Express for Word – along with the  .fob Report objects (141 25500-series) that are additionally provided — these custom objects contain default Word layouts that we will be tweaking in this step.

 

 

1. Modifying the Pre-Loaded Jet Word Templates 

The first step is to go to Report Layout Selection in NAV 2015. We can do this by either searching for that page in the search bar or by navigating to it nested under Departments > Administration > IT Administration > Reports. It should look something like this:

 

Report Layout Selection window in NAV 2015
Report Layout Selection window in NAV 2015

 

 

You’ll notice there are four columns. A brief explanation is as follows:

Report ID: the ID of the Report Object in the database (correlates to the Report ID in the Development Environment);
Report Name: the name given to the Report Object in the Development Environment;
Selected Layout: the option that toggles between the baked-in RDLC and Word layouts, as well as the Custom Layout (which allows to have many different variations on the same report);
Custom Layout Description: the description of the Custom Layout (if any) that is currently set for this report – e.g. “Sales Invoice with new EFT Info – 2015”, if you had an invoice temporarily in effect that was telling your customers about a change in EFT information.

We’re going to navigate/filter our way down to the 14125500 (Jet Ex. Word) ID series of reports to the 14125500 (Sales Order) template and click on the Selected Layout column to drop it down to Custom Layout, as shown below:

 

Report Layout Selection - 14125500 Report

 

 

The Custom Report Layouts screen should pop up at this point, asking you to specify the custom layout you’d like to use. If this is your first time playing around with custom layouts, you’ll probably see none in the  list.

On your ribbon, click New and then check off “Insert Word Layout” in the pop-up that appears. Click OK.

 

Insert Built-in Layout for a Report

 

Give your template a name and click Edit Layout in the ribbon. Microsoft Word should open and NAV in the background will have a prompt to import the changes. Leave this prompt popped-up and switch your window to Word.

You should see the Jet Express for Word browser on the right-hand pane of Word. If you do not, go to the Jet tab in the ribbon and click Design.

Now for the fun part — your template is ready for tweaking. On the left is your document and on the right is the Jet Express field browser.

 

Word 2013 and Jet Express for Word

 

 

You can do any necessary formatting changes directly on the left-hand (Word template). To insert a field from the Jet browser into your document, you simply click your cursor where you’d like the field, then find the field in the Jet Express field browser and double-click it. The field itself will appear as a Content Control and have a little bounding box around it and a reference label tabbed above it (as displayed):

 

Inserting Fields into Your Template

 

 

What will essentially happen is that when the template is “applied,” these bounding boxes will instruct the data to surface in that specific box.

You can place these virtually anywhere in your document — headers, footers, text boxes, tables, body, etc. You can even apply Word Art effects against them to really ramp up the weird factor…

 

 

Content Control Word Art

 

Limitations 

There are some limitations — the templates don’t like SmartArt. So if you were thinking of building a chevron process diagram, you might need to find an alternative approach to SmartArt (such as using an anchored chevron process image with anchored textbox overlay).

Additionally, non-text fields (such as date, time, amount, etc.) don’t have inherent formatting control (such as decimal place control or time formatting), so that would need to be addressed on the Report field level in the Development Environment.

Once you’re done with your tweaks, Save the document and then click “Yes” in the NAV pop-up that asks if you’d like to import the layout changes.

You can then preview your results by clicking on Run Report in the ribbon and click on Preview to open the Word template with data merged into it.

 

 

2. Creating a Template from Scratch

There are two basic approaches to creating a template from scratch — both realistically do the same thing but nevertheless are two approaches to linking NAV to Word. There might be some Development Environment work required if the fields you’re looking for are not already mapped in the XML schema — a hefty and separate topic in and of itself — but for now, we’ll focus on the general process in a situation where all the fields you want are already mapped.

 

a. Direct Entry Method – Service-Invoice Example

The initial steps mirror the ones laid out above:

The first step is to go to Report Layout Selection in NAV 2015. We can do this by either searching for that page in the search bar or by navigating to it nested under Departments > Administration > IT Administration > Reports. It should look something like this:

 

Report Layout Selection window in NAV 2015
Report Layout Selection window in NAV 2015

 

We’re going to navigate/filter our way down to 10474 (Service – Invoice) and click on the Selected Layout column to drop it down to Custom Layout, as shown below:

 

Report Layout Selection - Service - Invoice

 

 

 

The Custom Report Layouts screen should pop up at this point, asking you to specify the custom layout you’d like to use. On your ribbon, click New and then check off “Insert Word Layout” in the pop-up that appears. Click OK.

 

Insert Built-in Layout for a Report

 

Give your template a name and click Edit Layout in the ribbon. Microsoft Word should open and NAV in the background will have a prompt to import the changes. Leave this prompt popped-up and switch your window to Word.

You should see the Jet Express for Word browser on the right-hand pane of Word. If you do not, go to the Jet tab in the ribbon and click Design.

Now your template is ready for tweaking. On the left is your document and on the right is the Jet Express field browser.

 

Editing the Word Template for Custom Report Layouts

 

Next you just need to place in the dynamic fields — both captions and data fields — into your Word template. Below is what the header of the document would look like (fields inserted from the field browser highlighted in yellow):

 

 

Word Template from Scratch - Service Invoice (Header)

 

The next step is to insert a table in Word that will serve as the “replicating” lines of the service invoice, inserting the relevant line fields as necessary.

Create the table, put your headers in, insert your line-level fields and then highlight the entire row, including the “empty” column to the right of the table. Then right-click the line group header in the Jet Express field browser and click on Insert Repeater:

 

Row Replication in Jet Express for Word

 

So when we run the template, we see it output as:

Service Invoice - Report Layout Output

 

You’ll probably notice that the dates are actually date and time fields, the line quantities don’t show decimals, and there is no sub-total/total for the lines. You’d probably be tempted to insert a Word formula to address these matters [such as a “SUM(ABOVE)” formula at the bottom of the table], however the document won’t auto-calculate or update these fields, meaning you’d have to refresh all the fields manually. And since NAV 2015 will not accept macro-enabled documents, you can’t have it update automatically by an “update all” macro.

These matters, instead, can and should be addressed with a little bit of work by tweaking the Report object in the Development Environment.

 

 b. XML Part Method

With this step, you are exporting the XML schema, creating the template in Word, and then uploading the layout to NAV without having the layout window in the background waiting for you to finish to update.

The first step is to go to Custom Report Layouts in NAV 2015. We can do this by either searching for that page in the search bar or by navigating to it nested under Departments > Administration > IT Administration > Reports.

In this screen, you click New in the ribbon and then in the pop-up select which report you’d like to build a layout for in the Report ID box, check “Insert Word Layout”, and click “OK.”

 

Insert Built-in Layout for a Report

 

Give your layout a description and then navigate to the Actions tab and click on Export Word XML Part.

 

Export Word XML Part from the Actions Tab in the Ribbon

 

And then choose where to save the file and give it a meaningful name. Then, open up Microsoft Word, navigate to the Jet tab in the ribbon and click Design. This should open the Jet Express for Word interface on the right-hand pane.

 

Jet Express for Word Pane

 

 

 

Click on Browse… and select the XML file you saved from NAV. Similar to above, this now enables you to select the fields to insert into your template.

When you’re finished designing your template, navigate to the same report in the Custom Reports Layout screen and select Import Layout from the Actions ribbon tab and upload your Word template.

 

Import Layout in the Actions Ribbon Tab

 

The Verdict?

Overall, Jet Express for Word is an incredibly user-friendly feature that introduces a lot of flexibility to document reporting in Dynamics NAV. If you aren’t on NAV 2015 yet, this is definitely the kind of feature to take advantage of when planning your upgrade.

 

Planning Your Upgrade to NAV 2015

 

 

 

 

[button style=”btn-success btn-lg btn-block” icon=”glyphicon glyphicon-chevron-right” align=”left” iconcolor=”#81d742″ type=”link” target=”true” title=”Get the Newsletter” link=”http://www.catapulterp.com/contact-us/newsletter-sign-up/”]

Comments

  1. Abz

    hello i keep getting 0 and 0.00 for integer and decimal fields that are blank in NAV, but they appear 0 or 0.00, please help

    1. Hi Abz,

      Right out of the box, the default Jet Word templates will display ‘blank’ integers as 0 value. I actually had to change this recently for a client who uses “Description” lines (i.e. lines without a “Type”) that should not show any dollar amounts — set up in NAV like below:

      (Sales Order lines)

      The trick is to have the report object code handle all that so that Word can surface whatever the results are. What I did in the case above was create a function to pass in a text field for the dollar amount, with conditions that when the “Type” is blank, it should display a blank. The end result looks like:

      (Word template output)

      If you need help with this, feel free to e-mail me — I can be reached at ramin @ catapulterp.com.

  2. hi ramin,

    great posting!
    could you please publish the jet word templates you’ve developed for this posting?

    regards
    franz kalchmair

    1. Ramin Marghi

      Hi Franz,

      Took me a while to dig up the file from a few years back — I was able to find the final rendered version (not the one with the XML content controls).

      Hopefully it’s what you’re looking for:
      https://drive.google.com/file/d/0B41KqLM-PMVNLU1TZFgzd1NxQTA/view?usp=sharing

Leave a Comment

Your email address will not be published. Required fields are marked *

*

Filter:

Archives

Register to recieve the latest ERP & CRM insights