MS Office template

The MS Office template block allows you to prepare an Office-style (e.g. Excel) template based on data from a database, so that you can use a predefined document in a workflow. For example, you can prepare an attachment that is sent automatically when the invoice is returned.
Using variables, you can enter values into the template to suit your needs (e.g. an invoice rejection template, where the variables are used to enter the subject details, the linked bank account, etc.).
The block can be accessed from the menu Settings | Documentation | Workflow Design by clicking the panel Design | Input/Output.

Double-clicking the MS Office template block opens the MS Office template window:

In the form header, you need to define how a new file will be created and what name will be assigned to it.
Create MailMerge
|
Creates a document with fields for variables.
Clicking the button displays two confirmation pop-up windows:
- Do you want to open XLS dataset after creation? – Yes / No

- Do you want to prepare template file? – Yes / No

|
One
|
If checked, one document is created (e.g. when an invoice is rejected, one file is created with all rejected invoices from different subjects).
|
Many
|
If checked, multiple documents are created (e.g. when an invoice is rejected, a file with the rejected invoices is created for each subject separately).
|
Filename field
|
Enter the name that will be assigned to the file upon saving.
|
In the bottom part of the form, there are two tabs for setting up or entering SQL statements and defining variables.
(Variables…)
|
Opens the Workflow variables form, which allows you to add new variables to the workflow.
|
(Input field)
|
Enter an SQL query to specify the source of the data to be stored in the template.
|
The tab shows information on the variables. For the block to work properly, you need to define the two variables below:
- Dataset Filename – The full path to the file along with the filename. The filename must be 'WFMailMerge.xlsx' so that PANTHEON can create an Excel file that will later be used to link to MS Word. The Excel file will be populated with the data from the SQL query together with the header data.
- Template Filename – The full path to the file along with the filename so that PANTHEON can create MailMerge displaying the fields from the previous setting.

 |
HINT
For more information on how to use the MS Office template block, see the User manual for eWorkflows.
|