< Back to Quick Start Resources

Creating a Template in Word with XML Data

Quick-Start Guide

Download the Training Guide
WelcomeHow Does It Work?InstallConnect to DataDesign Template & Insert DataRefine OutputOutput Template

Welcome to Windward Designer

Windward Studios takes a unique approach to reporting. Our Report Designer sits directly inside Microsoft Office which means you get to use a familiar and powerful tool without having to learn a new designer. If you’ve ever used one of our competitors’ products, you may be familiar with their modular designers that require you to build reports using bits and pieces, where every bit of text or every piece of data is a distinct object in your template. Windward changes all of that. With Windward in Microsoft Office, you design report templates just like you design any other document, utilizing Tags to insert your data wherever you need it seamlessly in-line with your other text and content.

How Does Windward Work?

Before we jump into template design, let’s talk about the philosophy of Windward. Let’s consider the example of a local energy company. Every month they need to send out bills to all their customers. Their data might look something like this:

Table of Customers Energy Bills

Using Windward, you design a single template in Word or Excel that allows you to generate a unique bill for every one of your customers. The example template below uses Tags as placeholders for data. Every piece of text contained in brackets ([ ]) is a Tag and will be replaced with data when the bill is generated. Windward does the heavy lifting – we pull in all the relevant information from your Data Source and format it as specified in the original template.

See the example template and output below:

Example Template
Output for Mary Sue
Output for John Smith
Output for Bob Johnson

Now let’s look at one of our sample templates, the “VariableInvoice Sample – Template.docx”:

This template was created from scratch in Microsoft Word. Everything you see in the template, from the text to the header to the color formatting, functions just like it normally would in Word… with one major exception. All the colored text you see contained in Brackets [ ] are Tags. Windward uses Tags as placeholders for your data. Every Tag corresponds to an item in your Data Source. In this example, the Tags are used to fill in the data for any given Order Number and its subsequent information.

All the Tags are replaced with the corresponding data from the Data Source. Once you have Report Designer installed, you can open this template and play around with it to help get an idea of how Windward lets you design templates in a familiar environment where you can use all the tools available to you to build unique templates.

See the example template and output below:

Tolero Food Template
Tolero Food Output

Step 1 – Install

The first step to getting started is to install the Report Designer. Please visit the Windward Studios Downloads Page and download the Report Designer.

Please note: Windward Studios requires Microsoft Office running on Microsoft Windows to install.

1. Run the program WindwardWebInstall.exe.

2. Enter the License Key when prompted provided from the Windward Sales team or from the trial download email.  If you did not receive a License Key within 10 minutes of signing up for a trial,, please contact our Sales team.

3. Start Microsoft Word or Excel.

4. When Word or Excel first starts, it may indicate that you do not have a valid license. Click Yes. At the prompt, copy and paste your license key into the license key field.

5. Verify that the Windward menu is available by opening Microsoft Word or Excel. If Report Designer is not present, please reboot your system.

6. For Troubleshooting, see the Instructions page.

Step 2 - Connect To Data

In this training guide we are connecting to a sample XML Data Source provided by Windward.

1. Open Microsoft Word. Now that you’ve installed Windward Studios Report Designer, you will see two new tabs in the Microsoft Office Ribbon – the Windward tab and the Windward Tools tab.

Word Ribbon with Windward and Windward Tools tabs

2. Click on the Windward Tab and click on the Data Sources button located on the left-hand side of the ribbon.

Data Sources button

3. In the Connection Editor window, 1. in the New tab, 2. click on XML (Xpath2.0) under Web/File. The Details pane will change to prompt you for your data source details.

4. Enter a Nickname for your data source connection. It is best practice to always assign a nickname to your Data Source in the Nickname field. This will make your life much easier down the road when working with templates or tracking down issues.

5. Fill in the following fields:

  • Enter the following in the XML (File/URL): section: http://xml.windward.net/southwind.xml

6. Click Test, and then click Add to add your connection. If all parameters and credentials are correct and a connection is made, you will receive a successful notification. Click Close to close the window.

Download this Sample Template to follow along with the training.

Download the Training Sales Receipt Template

Step 3 – Design Your Template & Insert Data

In this Training Guide we’re going to build a very basic order receipt that is generated anytime an order is completed. Connect to Windward's public database in Step 2-Connect to Data to follow along.

1. Open the Sales Receipt Template and check that it is connected to the database provided from Step 2- Connect to Data.

Sales receipt

2. Now we’re going to insert a Tag that gives your template the ability to generate as many documents as you need – the ForEach Tag. The ForEach Tag is used to step through your Datasource and insert individual pieces of data for each entry in the Datasource.

First place your cursor at the very beginning of the document, before the ‘Dear’ text. Navigate to the Windward Tab, click the Tags dropdown menu, and click on the ForEach Tag to insert a ForEach Tag at the start of your document.

Place ForEach tag

3. Now we’re going to set up the ForEach Tag so it knows what data we want to insert into this template. Click on the Tag to select it and then click on the Wizard button in the Windward tab to open the XML Wizard.

Tag and Wizard

4. Click on the click here to add a node field at the top of the window, expand the windwardstudiosdatabase, expand Orders, select the Order table and click OK, click OK in the Wizard window, and then click Save Tag.

5. Now that we’ve specified that we want to use the Order table set of data in our template, it’s time to insert our data Tags.

a. Let’s start by inserting a Tag for the Company Name in place of our COMPANYNAME placeholder text. Begin by selecting and deleting the COMPANYNAME text.

b. Now use the Tags dropdown to insert an Out Tag.

c. Double-click on that Out Tag to open the Tag Editor window.

d. In the Tag Editor window click on the Wizard icon to open the XML Wizard.

The XML Wizard is used to create a Select Statement for the data. A Select Statement is what allows Windward to know exactly what data you want to pull from your Datasource to use in your report. This can seem technical your first time through, but the query uses common language and you should be able to understand what it is we’re going to pull from the Datasource as we build the statement. Since the CompanyName is in a different table than the Order information we’re going to make sure we’re pulling the correct CompanyName based off the OrderID.

Your final Wizard window will look like this:

e. Click on the first line ‘click here to add a node’.

f. Expand XML: southwind.xml, expand windward-studios, expand Customers, and then click on Customer to select the table and click OK.

g. Click on ‘click here to add a group’ on the second line. This defaults to ‘where all of the following conditions are true’.

h. Click on ‘click here to add a condition’ on the third line. Click on ‘click here to select anode’, expand the Customer tablein the popup window, select CustomerID, and click OK.

i. Click on ‘click here to set the value’, expand the dropdown, expand the Order table, and then double click on CustomerID.

We’ve now setup a condition that makes sure the CustomerName we’re pulling into our documentmatches the CustomerID associated with each Order we are generating a receipt for. The last step is toinsert the CompanyName.

j. Click on ‘click here to add a node’ on the sixth line, select CompanyName in the popup window, and click OK.

k. Click OK in the Wizard window, and then click Save Tag in the Tag Editor window.

Congratulations!

We just created the CompanyName Tag for our template.

Now let’s create the remaining tags for our template.

The OrderDate and OrderID tags are much easier to create since they are part of the Orders table we used for our ForEach tag.

6. For both of these tags, delete the placeholder text, insert an Out Tag, double click on the OutTag, expand the Order tableunder the ForEach in the left-hand side of the Tag Editor window, select OrderDate and OrderID for their respective Tags, and then click Save Tag.

7. Now we need to create Out Tags for all the items in our table. Delete the placeholder text, insert an Out Tags, double click on the OutTag, expand the Order table under the ForEach, expand OrderDetails, expand OrderDetail, select the appropriate node from the respective Tag, and then click Save Tag.

8. The final step is to add an End ForEach Tag so the document knows where to stop filling in data. Place the cursor after the Thank you! text and insert an End ForEach Tag from the Tags dropdown.

Our final template now looks like this:

Final template

Step 4 – Refine Your Output

On the Windward Tab you can use the Output dropdown to generate this template into a report in any supported format. Let’s start by generating it in DOCX format.

As you can see, we need to make a few revisions to our template to get it looking right.

1. The first easy fix is to move the End ForEach Tag to a new page so that we’re only generating one receipt per page. Place the cursor in front of the End ForEach Tag, and use the Insert tab to insert a Page Break before this Tag. This moves the End ForEach Tag to a new page.

2. Now let’s change the Data Type of the OrderDate, Price, and Discount Tags so they look better.

a. Double-click on the OrderDate Tag to open the Tag Editor.

b. Switch the main pane to the Properties pane, click in the entry field to the right of Format, and open the formatting window by clicking the button on the right of the entry box. The formatting window allows us to select a format for the Tag. This is very similar to Excel, where you are presented with options to standardize how this data is displayed in the output report. Since we’re formatting OrderDate, click on the Date option and then select the most appealing format for you. Once you have your format click Apply and then click Close. Finally click Save Tag to close the Tag Editor window. Your Tag doesn’t look any different, but when generated it will appear in the format you selected.

d. Repeat this process for the UnitPrice and Discount Tags, making sure that you select Currency instead of Date in the Formatting window.

4. Now let’s do some basic Word formatting on the rest of the document. Let’s bold the OrderDate and OrderID Tags as well as the first row of our table. Feel free to format the rest of the template in any way you wish - any formatting you define here will carry over to your generated document.

When you’re done, generate another DOCX output of the template to see the changes.

This output looks MUCH better. Receipts are now on individual pages and we’re bolding parts of thetemplate to draw attention to it. The Price and Discount columns are also now in commonly acceptedcurrency format.

Most customers find it very useful to make formatting changes and output their document frequently tosee how those changes appear. As you build more complex templates and use elements such as imagesand charts you’ll find that it moves the rest of your content around as data is inserted.

Step 5 – Output Your Template

Once you have completed formatting your output, you’re ready to complete the final output of your template. To test your template you may output using the Designer, but in production you’ll probably use one of our Windward Studios Report Engines. Most users use one of two methods for outputting from an Engine. The first option it to copy the DOCX or XLSX template to your Engine server and provide that template to the Engine as needed. The second option is to use the Generate Code button in Office which gives you the backend code you the Engine needs to output documents. The Generate Code button is found in the Windward Tools tab.

Download Sales Receipt Template.xlsx to follow along with the training.
Download Sales Receipt Template.docx to follow along with the training.

For over 10 years, Windward has lead the industry with our world-class document generation platform that creates visually stunning, data-powered documents designed exactly the way users want and are created in a fraction of the time and cost compared to existing solutions. Proudly located in Boulder, Colorado, Windward Studios is the premier solution for developers and business users adding reporting and document generation capabilities to their applications in over 70 countries around the world.