Module: Editor

Version: 4.2.1 +

User: Developer

Difficulty: Difficult

Introduction

In this exercise we will merge a table into a Word-document.

Prerequisites

- The Futurama Editor must be installed.
- Completing the tutorial Generating Documents first, is recommended.
- Completing the exercise Tax Rate (Medium) first, is recommended.

## Description

This assignment is a continuation of the previous assignment Tax Rate (Medium).

You can download the basis for this exercise (the end-result of this previous exercise, and the extra external files needed), by clicking here. These files are necessary for completing the assigment. Unzip and place the files in one develop-folder.

In this exercise we will merge a table into a Word-document. We want to add a table of tax rates to the document, to give us more clarification.

## Assignment

- Add the information below to the document, by merging it into the document from Futurama.

Rate of 10%        Factor 0.9
Rate of 20%        Factor 0.8
Rate of 30%        Factor 0.7

- Create PDF-documents instead of Word-documents.

Take the following steps to do so:

1. Create a UserVariable 'Rates' of type Double within the Node Tax Rate.
2. Create an XmlBuilder 'Loop' within the existing XmlBuilder 'Merge' and configure it as follows:
- RepeatData: refer to the 'Tax Rates' Table
- RepeatTarget: refer to the UserVariable 'Rates'
3. Create another XmlBuilder 'Data' within the 'Loop' XmlBuilder and fill it as follows:
- Create a reference 'Rates' to the UserVariable 'Rates'
- Create a formula 'Factor' that calculates the Net-factor based on the 'Rates' UserVariable
4. Verify by evaluating the 'Merge' XmlBuilder that the XML-data is now extended with three Data-entries, which hold the different tax rates and factors.
5. Open de Word document 'Letter.doc'. This document should be extended with the table information:
- At the top of the document, create a Mergefield named 'TableStart:Merge'
- At the bottom of the document (below the other mergefields), create a Mergefield named 'TableEnd:Merge'
On an appropriate place within the content of the document, we now will place the Table:
- Create a Mergefield named 'TableStart:Data'
- Create one line of content that holds the given text-line, and include the Mergefields 'Rates' and 'Factor'
- Create a Mergefield named 'TableEnd:Data'
- Set UseNestedData on 'True' to enable the table-construction
- Set DocumentFormat on 'PDF' to generate PFD's instead of Word documents.
7. Verify if your construction works by executing the Action from within the Editor or by clicking your batch-file.

## Tips

• Make sure you change the ResultFileName as well. It should have a .pdf-extension instead of .doc.
• If executing the Action doesn't work:
- Make sure you have writer's permission on the output-folder.
- Make sure you have closed the Letter.doc file before executing. The DocConverter won't work when your Word-file is still open!