DocFusion 365 - AIS a g e | 2 Table of Contents Introduction 5 About DocFusion® 365 5 About...

117
DocFusion®365 Designer User Guide

Transcript of DocFusion 365 - AIS a g e | 2 Table of Contents Introduction 5 About DocFusion® 365 5 About...

DocFusion®365 Designer User Guide

P a g e | 2

Table of Contents

Introduction ....................................................................................... 5 About DocFusion® 365 ................................................................................................................ 5 About DocFusion® 365 Designer ................................................................................................ 5

Software Installation .......................................................................... 6 Minimum Hardware Requirements .............................................................................................. 6 Microsoft Windows versions supported (both 32 and 64bit) ........................................................ 6

Installing DocFusion® 365 Designer ..................................................................................................... 6

DocFusion® 365 Designer Licensing ................................................. 8 Activation continued .............................................................................................................................. 9 Activation continued (2) ........................................................................................................................10 Activation continued (3) ........................................................................................................................11 Activation continued (4) ........................................................................................................................12 Activation completed ............................................................................................................................13

Getting started ................................................................................. 14 Overview .................................................................................................................................... 14 Let’s get started ......................................................................................................................... 15

Launching the DocFusion® 365 Designer ............................................................................................16 Exploring the DocFusion® 365 Designer Ribbon .................................................................................17 Smart Parts group commands ..............................................................................................................17 Advanced group commands .................................................................................................................17 View group commands .........................................................................................................................17 Document group commands ................................................................................................................17 License group commands ....................................................................................................................17 Smart Parts ..........................................................................................................................................18 Let’s look at each of these Smart Parts and their functionality in more detail: ......................................18 Advanced functions ..............................................................................................................................19 Start extending your document .............................................................................................................20 Creating the Data Structure ..................................................................................................................21 Creating the Data Structure continued .................................................................................................24 Creating the Data Structure continued (2) ............................................................................................25 Embedded Fonts ..................................................................................................................................26 Embedded Fonts continued ..................................................................................................................27 Mapping the Data structure to your document ......................................................................................28 Mapping the Data structure continued ..................................................................................................29 Adding SharePoint properties to the Data Model .................................................................................30 Continue mapping SharePoint Properties continued (2).......................................................................32 Continue mapping SharePoint Properties continued (3).......................................................................32 Drag and drop the data field’s on the document ...................................................................................33 Compose a Word/PDF document in SharePoint ..................................................................................34 Configure a template ............................................................................................................................35 Link template ........................................................................................................................................36 Compose a template ............................................................................................................................38 Compose a template continued (2) ......................................................................................................39 Compose a template continued (3) ......................................................................................................40 Using the ‘Mappings’ command ...........................................................................................................41 Using the ‘Mappings’ command continued ...........................................................................................42 Manual Mapping (advanced feature) ....................................................................................................43 Manual Mapping continued ..................................................................................................................44 Manual Mapping using the Expression Builder .....................................................................................45 Verifying Mappings ...............................................................................................................................46

Scenarios ................................................................................................................................... 47 Scenario Editor – Adding Rows ............................................................................................................48

P a g e | 3

Using the ‘Preview’ command with Scenarios ......................................................................................49 Using the ‘Preview’ command with Scenarios continued......................................................................50 Using the ‘Smart Part Properties’ command .........................................................................................51

Using Smart Parts ...................................................................................................................... 53 The ‘Repeater’ Smart Part ....................................................................................................................53 The ‘Repeater’ Smart Part continued ...................................................................................................54 The Repeater Smart Part continued (2) ................................................................................................55 Adding a ‘Calculation’ to a field ............................................................................................................56

Using Smart Parts continued ..................................................................................................... 57 Adding a ‘Calculation’ to a field continued ............................................................................................57 Adding a ‘Calculation’ to a field continued (2) .......................................................................................59 Adding a ‘Calculation’ to a field continued (3) .......................................................................................60 Adding a ‘Calculation’ to a field continued (4) .......................................................................................61 Adding a ‘Sum’ to a field .......................................................................................................................62 Adding a ‘Sum’ to a field continued ......................................................................................................63 Adding a ‘Sum’ to a field continued (2) .................................................................................................64 Testing the ‘Repeater’ Smart Part with a Scenario ...............................................................................65 Testing the ‘Repeater’ Smart Part with a Scenario continued ..............................................................66 The ‘Adornment’ Smart Part .................................................................................................................67 The ‘Adornment’ Smart Part continued.................................................................................................68 The ‘Adornment’ Smart Part continued (2) ...........................................................................................69 Testing the ‘Adornment’ Smart Part with a Scenario ............................................................................70 The ‘Adornment’ Smart Part using Control Flow ..................................................................................71 The ‘Adornment’ Smart Part using Control Flow continued ..................................................................72 The ‘Adornment’ Smart Part using Control Flow continued (2) .............................................................73 Testing the ‘Adornment’ Smart Part using Control Flow .......................................................................74 Testing the ‘Adornment’ Smart Part using Control Flow continued ......................................................75 The ‘Notes’ Smart Part .........................................................................................................................76 The ‘Optional’ and ‘Image’ Smart Parts ................................................................................................77 Using the ‘Optional’ Smart Part ............................................................................................................78 Using the ‘Optional’ Smart Part Continued ...........................................................................................79 Using the ‘Image’ Smart Part ................................................................................................................80 Adding images to Scenarios .................................................................................................................81 Adding images to Scenarios continued ................................................................................................82 Adding images to Scenarios continued (2) ...........................................................................................83 The ‘Reference’ Smart Part ..................................................................................................................84 The ‘Reference’ Smart Part continued..................................................................................................85 The ‘Reference’ Smart Part continued (2) ............................................................................................86 The ‘Reference’ Smart Part continued (3) ............................................................................................87 The ‘Validate’ command .......................................................................................................................88 The ‘Hierarchy’ command .....................................................................................................................89 The ‘Toggle Markup’ command ............................................................................................................90 The ‘Task Templates’ command ..........................................................................................................91 The ‘Task Templates’ Editor .................................................................................................................92 The ‘Task Templates’ Editor – Adding a parameter .............................................................................93 The ‘Task Templates’ Editor – Adding a parameter continued .............................................................94 The ‘Task Templates’ Editor – Adding Configuration ...........................................................................95 The ‘Task Templates’ Editor – Adding Adornments .............................................................................96 The ‘Task Templates’ Editor – Adding Adornments continued .............................................................97 Adding a ‘Task Templates’ to a Data Field ...........................................................................................98 Testing ‘Task Templates’ ......................................................................................................................99 Testing ‘Task Templates’ continued ...................................................................................................100 Testing ‘Task Templates’ continued (2) ..............................................................................................101 The ‘Queries’ command .....................................................................................................................102 Adding a Query ..................................................................................................................................103 Adding a Query source .......................................................................................................................104 Adding a Query source continued ......................................................................................................105 Add a “Where” clause to the Query ....................................................................................................106 Testing a Query ..................................................................................................................................107 Mapping a Query to your template document .....................................................................................108 Mapping a query continued ................................................................................................................109 Mapping a Query continued (2) ..........................................................................................................110

P a g e | 4

Mapping a Query continued (3) ..........................................................................................................111 Testing the mapped Query .................................................................................................................112 The ‘Custom Functions’ command .....................................................................................................113 Adding a custom ‘Template Script’ .....................................................................................................114 Mapping a ‘Custom Function’ script to a data field .............................................................................115 Testing Custom Functions ..................................................................................................................116

Importing and Exporting ........................................................................................................... 117 Removing Extensions and Uninstalling the DocFusion ® 365 Designer ................................. 117

P a g e | 5

Introduction

About DocFusion® 365 DocFusion® 365 is a dynamic, template-driven document composition and automation engine designed

to help you manage all of your document content and processes. The DocFusion® 365 suite includes the following components:

DocFusion® 365 Designer (Microsoft Word Add-In)

DocFusion® 365 Composition Engine (SharePoint Online Add-In)

About DocFusion® 365 Designer The powerful and versatile DocFusion® 365 Designer is installed as an add-in for Microsoft Word and comes with a set of tools that can be used to create feature-rich and intelligent templates which will play an essential role in moving towards automating your document processes. Easily link to custom lists from SharePoint and map them to your template. Upload your final template to a SharePoint document library and use the configuration tool to link your template to a SharePoint list.

P a g e | 6

Software Installation

Minimum Hardware Requirements

1.5 GHz Processor

512MB RAM

4GB Hard Disk Space

Microsoft Windows versions supported (both 32 and 64bit)

Microsoft Windows 7

Microsoft Windows 8

Microsoft Windows 10

Installing DocFusion® 365 Designer

Browse to the DocFusion® 365 Composition add-in under your SharePoint’s Site Contents. Selecting

this add-inn will navigate you to the DocFusion ® 365 landing page where you can click on the

‘Download Add-In’ link to guide you to start the DocFusion® 365 Designer VSTO installation.

(please also visit How to get Started if you need further assistance)

P a g e | 7

Click on ‘Install’ to continue

The DocFusion® 365 Designer is now installed and ready for use.

P a g e | 8

DocFusion® 365 Designer Licensing

Before you can use the DocFusion® 365 Designer Editor, the product needs to be activated by entering product code details that will be supplied by the publisher.

To launch the DocFusion® 365 Designer, start Microsoft Word.

The DocFusion® 365 Designer Word add-in will now load. Click on the ‘DocFusion’ tab to access the ‘Activate’ command.

P a g e | 9

Activation continued

Click on “Activate” then Choose Server Licensing

P a g e | 10

Activation continued (2)

Server Licensing Enter the following into the Server Uri: https://aiscloud.co.za:8156/ and click next. The AIS License Manager will pop up where you will need to enter your Office 365 user credentials.

P a g e | 11

Activation continued (3)

The activation process will now verify online if required by the license type. If you encounter any errors, please verify that the correct Server Uri was used or contact the publisher to verify.

P a g e | 12

Activation continued (4)

Click on ‘Finish’ to complete the activation process.

P a g e | 13

Activation completed

Once the activation process completes successfully, the DocFusion tab’s Ribbon will have two commands that can be accessed. The ‘Extend Document’ command will extend your current Word document for use with DocFusion® 365. The ‘Information License’ command will display your license details.

P a g e | 14

Getting started

Overview The DocFusion® 365 Designer allows you to take a static document and extend it into a DocFusion® 365 template. All of the DocFusion® Designer tools will be at your disposal to build intelligent templates for smart document composition. The following chapter with give you a summarized overview of all the DocFusion® 365 Designer tools and their functions. Your journey to document automation starts here!

P a g e | 15

Let’s get started

Below is a sample of a statement document.

P a g e | 16

Launching the DocFusion® 365 Designer

To launch the DocFusion® 365 Designer, open Microsoft Word. (if you have not done so already)

Create a new blank Word document

Click on the ‘DocFusion’ tab

Click on the ‘Extend Document’ command to get started

P a g e | 17

Exploring the DocFusion® 365 Designer Ribbon

Once you have clicked on the ‘Extend Document’ command on the DocFusion® 365 ribbon, the ribbon will contain the DocFusion® 365 Designer tools. The DocFusion® 365 ribbon below, is divided into five sections/groups.

Smart Parts group commands

Smart Parts allow you to build functionalities onto your text elements (literal text strings / word or phrases) that always behave in a certain way, drawing information from the data entities created.

Advanced group commands

The ‘Advanced’ group of commands provide additional functionalities on creating more advanced ways of

enhancing the appearance and content of certain parts of information used from the external database

and displayed in the final document.

View group commands

The ‘View’ group of commands are a set of utilities to aid the template designer in understanding and viewing the extensions created on a document.

Document group commands

The ‘Document’ group of commands contain only one command, ‘Remove Extension’. You would use this to remove all DocFusion ® functionality from a Word document.

License group commands

The ‘License’ group of commands contains only one command, ‘Information’. This will display the licensing information of the product.

P a g e | 18

Smart Parts

Let’s look at each of these Smart Parts and their functionality in more detail:

The ‘Optional’ command allows you to highlight a word, phrase, sentence or paragraph you would like to mark as optional in the document, depending on a condition. If the condition is met, the word, phrase, sentence or paragraph would be inserted into the document

The ‘Reference’ command allows you to design a DocFusion® 365 template to call any other Word document or DocFusion® 365 Template on the local file system, DocFusion ® server or SharePoint, this will use the “Library Element” created.

Click on the Repeater command to insert a repeater component that can be linked to tables created in the Data Schema to form a table of elements to be displayed. Repeaters allow for words, clauses or sections with data fields to be repeated.

Notes are used to insert drafting notes into the document describing more detail about certain elements or text used. Notes will not be present in the final document when it is Composed.

Insert an image into the document by selecting its properties or file location and adding this referenced lookup to your document

Remove any allocated Smart Part in your document by selecting the Smart Part and then clicking on remove.

Pre-defined data fields or “place holders” that will be replaced at run-time when the document is Composed.

A “Library Element” ” is creating part or a whole section of a document that will be a “Reference” in your DocFusion template

P a g e | 19

Advanced functions

Let’s look at each of these Advanced functions and their functionality in more detail:

The ‘Custom Functions’ command enables you to use an IDE Script / code development platform to add custom code or script to certain ‘Data Fields’ of the document that requires advanced functionality not available in the Smart Parts.

The ‘Data Schema’ command allows you to open/create a simple or complex Type building platform where the structure of Data elements within the Word document can be built. These Types the model of values used to populate the content of the Document from the values stored in the various columns of the table

The ‘Adornments’ command enables you to decorate the text of a data field. This can take the form of normal text formatting, like color, font, or weight, but also enables specialized formatting, such as writing out a number in words. What makes adornments different to the formatting traditionally available in word, is that it is also conditional, i.e. make the text red if the value is negative. This makes adornments a very powerful formatting tool.

The ‘Query Selector’ command allows you to build certain condition specific queries that call certain values from the tables in the data schema and populates the values in the document.

The ‘Task Templates’ command can be used to create ‘Task Templates. With this feature, you can create your own sequence of existing ‘Adornments’ and/or existing ‘Task Templates’ that you find you use often. Instead of using the individual ‘Adornments, you will use a sequence of ‘Adornments’ captured inside a ‘Task Template’.

The Microsoft SharePoint enables you to map custom lists created in SharePoint easily onto a Microsoft Word document.

Insert Dynamic Chart.

P a g e | 20

Start extending your document

Looking at our sample statement, we can see that the customer’s title, name, surname, address, city and

postal code data is required.

There are various ways to use the DocFusion® 365 Designer and Word to create your template, but let’s

start by using the ‘Data Schema’ command to create the customer details layout. Once you have clicked

the ‘Data Schema’ command, the ‘Data Model’ screen will open to the right of the document.

Data is organized inside tables and the ‘Data Model’ screen will start off with a default Type called ‘Shema’.

You will add Data Types within this Schema, it is best to add your own Types and name the Complex

Types with a meaningful name.

P a g e | 21

Creating the Data Structure

The data used in creating documents with DocFusion ® Designer, can be obtained from any or multiple external sources, for example an external database, CSV/XML files, Web services and SharePoint Lists etc. In most environments information will be provided to the individuals creating the templates by the developer or database administrators. This external information is then used in the design and creation of document templates in the DocFusion ® Designer.

Click the ‘Show Types’ icon to add a new simple/complex Type. Then click on ‘Add Type’ icon.

P a g e | 22

Click on ‘Create New Type’ and type in ClientDetails. Select ‘New Entity’ as “Schema” is your only base type. Click “Save” and popup window will close.

Select “Schema” then Click on the ‘Edit Entity’ icon.

Click on the ‘Add Entity’ icon.

P a g e | 23

Create a property which will look like the following by selecting the “ClientDetails” as the Data Type and click ‘save’ and close the popup

The Type will contain the data layout for the Client details.

The ClientDetails Type has now been added to the data schema of this template document.

P a g e | 24

Use the ‘Show Types’ icon to delete a Type if required or Edit Types to rename the Complex Type if required.

Creating the Data Structure continued

Types contain ‘Columns or Properties’ and inside the Data Model, also the Data Type and optionally a calculation.

Select ClientDetails Type then click the ‘Edit Entity’ icon to add a properties/column. Name the

column ‘Title’ and select ‘Text’ as the data type for Title. The name you give to the column is very

important. You might have received the names of the fields from a developer beforehand. Use

those names as it will be matched with the actual data at runtime, when

the document is Composed. If you create the field names, the

developer will extract the data schema when merging the template

document with the application code.

P a g e | 25

The column ‘Title’ is now added to the Type ClientDetails.

Use the ‘Delete Column’ icon to delete a column if required.

Use the ‘Edit Column’ icon to change the name, Data Type or Calculation if required.

Creating the Data Structure continued (2)

Using the ‘Add properties’ icon, add the other client detail fields as shown below. Cater for two address lines and note that PostalCode is an “Integer” under Data Type. When done close ClientDetails Properties popup.

The ClientDetails fields have no calculations, this will be covered later.

P a g e | 26

The next step is to layout the customer details in the Word document. You can use all of Word’s features

to do this. When you do the layout, use wording that corresponds to the column names you have just

created. This will make the data binding easier.

Use all the fonts, styles and colors as required, from the normal editor tools in Microsoft Word. You can insert tables, paragraphs an all required text elements necessary in your document as you would in any other Microsoft Word Document. You can also add images, shapes and lines, text parts like a header, footer, footnotes etc. The DocFusion® 365 Designer Add-In allows you to add the data elements required to transform your Word document into a dynamic business document.

Embedded Fonts

If you are using a custom font or your document does not generate according to the fonts, you will need to ‘embed’ the font into the document in order to maintain the font style during generation. To embed the font, follow the below steps: Click on ‘File’ and select the ‘Option’ link

P a g e | 27

Embedded Fonts continued

Click on ‘Save’. Then scroll down to the ‘Preserve fidelity when sharing this document’ section.

Tick the box ‘Embed fonts in the file’.

P a g e | 28

Mapping the Data structure to your document

Use Word and layout the customer details as they appear in the sample document. Remember to use words that are similar or the same as the column names that you have created in the data schema. The example below has the Word document on the left. Select the appropriate Word tabs (Home, Insert etc.) to construct your new document.

Notice the usage of Word functions and text colors inside the Word document. All Word’s functionality is available to use. The next step is to map the Word document fields (words) to the Data Model under the ClientDetails Complex Type. To do this, you need to go back to the DocFusion tab.

P a g e | 29

Mapping the Data structure continued

To complete the mapping process, you need to indicate the data fields to DocFusion® 365 in your Word document by using the ‘Data Field’ Smart Part. Simply highlight each word that represents a field that will contain variable data and the click on the ‘Data Field’ command. Let’s start with title. Once you have clicked on the ‘Data Field’ command, you will notice that the word ‘Title’ now has a box around it with a heading of the same name. This indicates that the DocFusion® 365 Designer is now aware of the Title field and can at runtime insert data into it, while retaining the Word attributes like color, Bold etc.

While you map out all the data fields, you might need to delete ‘Data Fields’ marked in error. Simply

select the ‘Data Field’ in error and click the command.

P a g e | 30

Adding SharePoint properties to the Data Model

Creating a new Document to import your SharePoint Lists. Say for example you have a custom list of

the company details on your SharePoint site, and you want to map this on the ‘Client Details’

document. With DocFusion® 365, you can automatically Compose a Data Model that contains all data

fields on a Word document from the list records stored on SharePoint. There is no need to create the

data fields from scratch, as the information is pulled directly from SharePoint.

The DocFusion® 365 engine pulls the correct data and composes the document that you want.

Click on the ‘Create SharePoint Properties’ command to link your list.

P a g e | 31

The SharePoint Properties window will appear. Enter the SharePoint URL where the lists are kept.

Connect to the SharePoint URL. You will be prompted to enter your SharePoint credentials for security

reasons. You may be asked to login for every List and Lists linked to the imported List from SharePoint

P a g e | 32

Continue mapping SharePoint Properties continued (2)

When you’re logged in, click on the ‘List Name’ dropdown and select the Custom SharePoint list that

you created. In this example: ‘Employees’.

Continue mapping SharePoint Properties continued (3)

Select the relevant fields you want to import from this list and click on the ‘Save’ command.

The fields will appear in the Data Model ready for you to start mapping onto the word document.

P a g e | 33

Drag and drop the data field’s on the document

Click on a field and drag this onto the Word Document where required. Map your header by the

company name, etc

P a g e | 34

Preview your document by clicking on the ‘Preview’ command.

Compose a Word/PDF document in SharePoint

Compose a new document or select a document with fields that you have mapped from SharePoint, for

this example: ‘Employment Letter Main’:

P a g e | 35

Drag and drop or upload the document in a SharePoint list and call it ‘DocFusion Templates’.

Configure a template

Go to the list that you want to Compose from, for example ‘Employees’. Select an employee entry and

then click on the ‘List’ tab at the top of the screen.

P a g e | 36

Click on the ‘Configure’ command.

Link template

Click on the ‘Link Template’ command to configure a document for the employee.

A window will open where you need to enter information and select the template output. Select the

‘Employee Letter’ template and enter the details on each empty textbox as below. Select the output

format as a Word document or PDF.

P a g e | 37

Click on the save icon.

When saved, you will be greeted with the screen below. Click on this command which will take you

back to the employees list.

P a g e | 38

Compose a template

Once you are back in your custom list, select the entry again and click on the ‘Items’ tab at the top of

the screen.

Click on the ‘Compose’ command.

Select the ‘Employee Letter Main’ by ticking the box to confirm. Then click on ‘Compose Selected

Items’. When you have multiple items on the list, then you can click on ‘Compose All Items’.

P a g e | 39

Compose a template continued (2)

When done, a ‘success’ notification will be shown.

P a g e | 40

Compose a template continued (3)

Go to your ‘Output’ folder (which you specified when you “Linked” the template) where the document

has been saved. In this example, we have selected the ‘DocFusion Templates’. Open the composed

‘Employee Letter Main’ for the entry you selected.

Let’s go back to your “Client Details” document

P a g e | 41

Using the ‘Mappings’ command

The command under the View group will open the Mappings windows to the left of the Word document. The ‘Mappings’ command will try to match the Data Field names used in the Word document to the Complex Types

and columns created inside the Data Schema. For the ‘Suggested Mapping Source’ that matches, simply click on the action ‘Map to suggested’. The mapping will disappear once mapped. If you need to see all the mappings done, uncheck the ‘[Is Mapped]’ option at the bottom left of the Mappings window.

P a g e | 42

Using the ‘Mappings’ command continued

From our example below, you will notice that a few of the suggested mapping sources are incorrect. These have to be corrected by clicking on the drop down next to the word ‘None’ under “Current Mapping Source” tab, for the affected mappings. Select the appropriate mapping using the names starting with a ‘@’ sign is recommended.

P a g e | 43

Manual Mapping (advanced feature)

After mapping all the fields to the data schema, you will notice that three of the fields are not mapped and there are no matching maps

back to the Complex Type created for ClientDetails. Here we can use the ‘Manual Mapping’ tab to do the mapping. This is an advanced

feature and you might prefer to use ‘Adornments’ command that is discussed later in the document to do the same.

P a g e | 44

Manual Mapping continued

The “DateToday” field needs to display the current date. The ‘Manual Mapping’ page has various options

that will be explained later. It will also provide access to built-in Expressions like the current date. Select

the ‘Expression’ tab and then click on ‘Next’ to the Expression text box to access the ‘Expression Builder’.

P a g e | 45

Manual Mapping using the Expression Builder

Expand the Functions to access the pre-defined expressions available for usage. Then expand the Date/Time function. Notice that all of the remainder of the three fields to map in the sample document, can be linked to Date/ Time functions. The ‘TODAY’ will insert the current date and time, the ‘YEAR’ the current year and the ‘MONTH’ the current month to complete the mapping exercise. As you select the functions, a short description will be displayed in the bottom window of the Expression Builder. Double click on the function required. It will be displayed in the right window of the Expression Builder. Although TODAY will return the date and time, we only want the date. Thus we have to FORMAT the TODAY function to only return the date, FORMAT(TODAY(), “d”). The FORMAT(TODAY(), “MMMM”) will return the month and FORMAT(TODAY(), “yyyy”) will return the year.

Before you click ‘OK’ to exit, ‘Validate’ and then ‘Evaluate’ your expression to see if it works and produces

the desired result. Click ‘OK’ to save and ‘OK’ again on the ‘Manual Mapping screen.

P a g e | 46

Verifying Mappings

To check all the mappings done, uncheck the [Is Mapped] tick-box at the bottom of the Mappings screen.

You should now see all the mapping including the expressions used for some of the fields. If you need to

change any of the mappings, simply click on the ‘Current Mapping Source’ next to the Mapping Target

requiring change and change it to what is required. You can also un-tick the ‘Is Mapped’ tick-box that will

un-map the ‘Mapping Target’ completely.

Close the Mappings window to continue to the next activity.

P a g e | 47

Scenarios Scenarios are used to test your template document outside of the DocFusion ® runtime environment. You can also use scenarios to test the conditional settings on data fields. Scenarios can also be exported and imported to share if you work in a team.

The command can be found inside the ’View’ group of the DocFusion ® Designer. The Scenario Editor works a lot like the Data Schema editor. Use the icon to

add a scenario. Type a useful name and description for the scenario. The ID of the scenario will be Composed and cannot be entered.

You can also: Edit Copy Delete Scenario details.

Click ‘SAVE’ to save the new Scenario.

P a g e | 48

Scenario Editor – Adding Rows

First select the correct Type name you wish to add data for in your scenario. Then use the icon to add a

row of data for the selected Type.

You can also: Delete or copy a row of data.

Click ‘SAVE’ to save the Scenario.

TIP: Always save your work regularly!

P a g e | 49

Using the ‘Preview’ command with Scenarios

Once you have saved your scenario, you can ‘Preview’ the document your template will create. The

preview process will merge the data you supplied in the scenario you select to preview, with your template

document currently open in Word and produce a .PDF document to view. Let’s take our example template

and ‘Preview’ the scenario ‘Test Name and Address’.

Click on the ‘Test Name and Address’ menu option to start the Scenario Preview.

P a g e | 50

Using the ‘Preview’ command with Scenarios continued

The Preview command produces the output PDF document below. Notice the red error message where

the second address line should have been or a blank space where this should have been displayed. The

input data of the scenario had no data for address line two and this is what is causing the error or blank

space.

Close the PDF document to continue editing to resolve the error.

P a g e | 51

Using the ‘Smart Part Properties’ command

The ‘Smart Part Properties’ command under the ‘View’ group, shows the properties of the selected Smart Part. Here you can change the properties if required. It also has a tick-box ‘Collapse if value is blank’ that is not selected by default.

Tick ‘Collapse if value is blank’ for the Address 2 line and click ‘OK’ to save the changes.

P a g e | 52

Re-test the Preview with Scenario again

Run the ‘Preview’ on the scenario again. This time, the preview will finish without errors as the blank data field will be suppressed. Notice that all the Word effects like text color, bold, underline and italic were retained in the final document.

So far we have covered basic functionality to start creating your template document. The next step is to

use a Smart Part called a Repeater to insert a list of items into a Complex Type inside the document to

display statement line items.

P a g e | 53

Using Smart Parts

The ‘Repeater’ Smart Part

Repeaters allow for words, clauses or sections with data fields to be repeated if there are multiple records on some entities in the data model, for instance, a list of tenants in a Rental Agreement or a list of shareholders on a document footer or a certain clause that may have to be repeated for every phase of a development. When a paragraph is repeated, the numbering will automatically continue for every instance of that paragraph during the time of the generation of the document. In our example statement document, the customer’s monthly purchases is a good example of where a ‘Repeater’ Smart Part can be used. The column headings are the same but the data and number of rows (transactions) will differ from month to month and also between customers. As with the ClientDetails, create a Type for ‘Transactions’ using the ‘Data Schema’ command which will open your Data Model. See below the fields for the “Transactions” Complex Type to be added

P a g e | 54

The ‘Repeater’ Smart Part continued

The next step will be to layout the statement details in your document. There are a couple ways to do this

Use Word to create a Table (2 rows with 6 columns) o Use Word’s ‘Table Tools’ to design the table (style, color, borders) o Create the column headings on the first row o Select the whole second row of the table and add a ‘Repeater’ Smart Part o On the second row, create names for the data field names o Mark each of the data field names and mark them with the ‘Data Field’ Smart Part o Use the ‘Mappings’ command to map the ‘Repeater’ and ‘Data Field’ Smart Parts as before

Map the ‘Repeater’ to the ‘Transactions’ complex type you created in the data elements

Map each of the ‘Data Fields’ to the corresponding columns in the ‘Transactions’ complex type

Use Word to create a table (2 rows with 6 columns) o Use Word’s ‘Table Tools’ to design the table (style, color, borders) o Create the column headings on the first row o Select the whole second row of the table and add a ‘Repeater’ Smart Part o Drag the individual columns names from the Data Element view onto your newly create

tables corresponding columns

You can also simply drag the whole ‘Transactions’ complex type from the Data Element view onto your Word document to automatically create a table in Word

o This method is much easier and gives you more options to quickly create tables as shown on the next page

P a g e | 55

The Repeater Smart Part continued (2)

Using the 3rd option by just dragging the “Transactions” Type into Word, the DocFusion® 365 Designer will now automatically create the table in your document, and mark it as a ‘Repeater’ Smart Part, insert the column captions, name the data fields and also mark them as ‘Data Field’ Smart Parts. The mappings to the columns in the ‘Transactions’ complete will also be done automatically, but just double check them. Use Word features to design the look and feel of your newly create table to match the sample statement. At this point, you will notice that at the end of each line you need to total up the quantity and the unit price. This will require a ‘Calculation’ to be setup for this field.

P a g e | 56

Adding a ‘Calculation’ to a field

Use the ‘Data Schema’ command to open the ‘Data Model view if not already open. Click on the ‘’Total’

field and then click on ‘Edit Entity’. This will open up options available.

This will open the Transactions properties. Click on the ‘Edit Property’ icon.

P a g e | 57

Using Smart Parts continued

Adding a ‘Calculation’ to a field continued

Click on the ‘Smart Value’ dropdown.

Click on the ‘Expression’ tab and click on ‘Edit’

P a g e | 58

Expand the ‘Context Variables’. These variables will map back to the Types and fields you created in the ‘Data Schema’.

P a g e | 59

Adding a ‘Calculation’ to a field continued (2)

Double-click on the [@Transaction].[Qty] to select the field. Add the arithmetic symbol ‘ * ’ for multiplication and double-click on the [@Transaction].[Unit_Price] to select the second field. The expression will build on the right window as you progress.

Before you click ‘OK’ to save the expression, click ‘Validate’ to validate expression for errors.

P a g e | 60

Adding a ‘Calculation’ to a field continued (3)

The last thing to do is to click on ‘Evaluate’ to test your expression to make sure it has the effect you wanted.

Enter some test values to test and click on ‘OK’ to continue.

P a g e | 61

Adding a ‘Calculation’ to a field continued (4)

The result of the ‘Evaluation’ will now be displayed in the bottom window. Check if it matches the test data you used.

Click ‘OK’ to save the expression. The calculation will now reflect in the properties of ‘Total’ under ‘Smart Value’.

TIP: Always save your work regularly!

P a g e | 62

Adding a ‘Sum’ to a field

The sample statement also requires a sum of all the ‘Total’ column fields at the end of the statement

lines. Use Word (tab) to create an extra row for your table. Enter the word ‘GTotal’ under the ‘Total’

column in the new row. Select the GTotal word and add a ‘Data Field’ Smart Part.

P a g e | 63

Adding a ‘Sum’ to a field continued

Use the ‘Mappings’ command to open the mapping for the new GTotal field. Click on the ‘Current Mapping Source’ and then the ‘Manual Tabbing’ tab. Select the ‘Source Aggregate’ tab to access the aggregate function. Select ‘Sum’.

P a g e | 64

Adding a ‘Sum’ to a field continued (2)

The ‘Sum’ function need to be mapped to the ‘Transaction’ Type you created. Add the ‘Total’ property name as the field that the ‘Sum’ function needs to sum.

You have now completed setting up the ‘Repeater’ Smart Part and also added a ‘Calculation’ to a field with a grand total sum of all the ‘Total’ fields at the bottom of the table. Should a second page break occur because of the number of statement lines, the grand total will appear on the next page.

P a g e | 65

Testing the ‘Repeater’ Smart Part with a Scenario

Let’s go back to the ‘Test Name and Address’ Scenario. Click on the ‘Scenarios’ command in the ‘View’

group under the DocFusion ® tab to open up the Scenario Editor again. First change the name of the

scenario to something more meaningful to describe the scenario. Use the icon to do this. Change

the name and description to reflect ‘Test Statement’.

To complete the scenario, select the Type ‘Transactions’ and add a few rows of transaction data as

below.

P a g e | 66

Testing the ‘Repeater’ Smart Part with a Scenario continued

‘Preview’ the updated scenario to see the effects.

From the above, you will notice that the document assembled as designed, but it could look better. The Date column has the time as well, The Ref No would look better capitalized, Qty will look better centered and the amounts needs to be currency and left aligned. For the alignments, use normal Word functionality.

P a g e | 67

The ‘Adornment’ Smart Part

The ‘Adornments’ command, under the “Advanced” section, enables you to decorate the text of a data field. Let’s start with the ‘Date’ field. Click on the ‘Date’ field (not the header) until the ‘Data Field’ box appears around the word ‘Date’ (make sure it is not the Repeater Smart Part).

Click on the ‘Adornments’ Smart Part under the Smart Parts group to open the Adornments editor. Click on the ‘Input Value’ line to select the line. Like all the other editors, you have an Add, Edit, and Delete icon for the ‘Adornments’. Additionally the ‘Add Flow Control’ icon can be used to build ‘if, else, or return’ logic to check for conditions. Click the ‘Add’ adorment icon to add an adorment to the ‘Transaction Date’ and select

“Format Date” from the list

P a g e | 68

The ‘Adornment’ Smart Part continued

There are a lot of adornments to choose from. You have selected the “Format Date”.This will insert the adornment code, but still needs you to select what you want it to do. Click on the NONE (this is where you need to specify what you want). The ‘Edit Parameter’ screen will open up auto selecting the field as a Constant Value. Click on the ‘Constant Value’ drop down and the options for Date will be displayed. The ‘Combined Format’ is already set to ‘DateOnly’. Click the drop-down arrow again or anywhere off the Date options to select.

Click on “Save” and the window will close.

TIP: Always save your work regularly!

P a g e | 69

The ‘Adornment’ Smart Part continued (2)

Do the same for the currency fields (Unit Price, Total and GTotal). Add an “Adornment” and this time select ‘Format Number’.

You can add ‘Decimal Digits’ and do all kinds of formatting to the currency as required. Please note that all your currency fields must be checked if Decimal Digits are set to 2.

See if you can use an adornment to capitalize the Ref No’s first character as well.

P a g e | 70

Testing the ‘Adornment’ Smart Part with a Scenario

‘Preview’ the ‘Test Statements’ scenario again to see the effects of the ‘Adornments’ added to the fields. Remember that Word was used to do the alignment of the fields to the center and right.

P a g e | 71

The ‘Adornment’ Smart Part using Control Flow

The last line in our sample statement is an advertising line. Let’s say that the recommend item on special has to be different based on the customer’s title. For MR display a different item as for MRS. Add the advertisement line to your document with Word. Mark the word that will represent the specials item as a Data Field and add an Adornment to the Data Field. Use the ‘SetValue’ adornment.

Make sure the ‘Set Value’ line is selected and click on the icon to add an ‘if - Control Flow’.

Add an ‘else - Control Flow’ to the ‘if - Control Flow’ as well.

P a g e | 72

The ‘Adornment’ Smart Part using Control Flow continued

Remove the first ‘Set Value’ statement by selecting the line and using the delete icon as we don’t need it. The ‘if’ and the ‘else’ part needs an instruction to execute. Add a ‘Set Value’ adornment to the ‘if - Control Flow’ and the ‘else - Control Flow’. You can move the ‘if’ statement above the Set Value as shown below.

The basic outline of the ‘Set Value’ statement with a selection statement (if / else) is now complete. All that needs to be done is to complete the condition for the ‘if’ and replace the ‘NONE values with the specials items.

P a g e | 73

The ‘Adornment’ Smart Part using Control Flow continued (2)

The ‘if’ statement needs to be completed. Click on ‘True’ to open the ‘Edit Parameter’ window, select ‘Expression’ and then ‘Edit’. We want to check the title for ‘MR’ to set the Pink Scissor specials item. Select the [@ClientDetail].[Title] from the Context Variables (maps back to your ClientDetail Complex Type), use the == (equals) and then ‘MR’. (This must look exactly as the Data in the scenario Title Field or in the database e.g. MR MR or e.g. Ms Ms )

On the ‘if’ statement, click on ‘NULL’ and replace with constant ‘Power Drill 3000’. On the ‘else’ statement, click on the NULL and replace with constant ‘Pink Scissors’. This completes the ‘Control Flow’ for the specials item field. The field will be populated based on the value of the customer’s title.

P a g e | 74

Testing the ‘Adornment’ Smart Part using Control Flow

‘Preview’ the ‘Test Statements’ scenario again to see the effects of the ‘Adornments’ using ‘Flow Control’ has.

Note that the ‘Power Drill’ special is recommended for MR Smith.

“Power Drill 3000”

P a g e | 75

Testing the ‘Adornment’ Smart Part using Control Flow continued

Use the ‘Scenarios’ command and then copy your test scenario to setup a scenario to test the ‘MRS’

scenario. Change the copied scenario to reflect a ‘MRS’ title with different data details if required.

‘Preview’ the ‘Test Statements MRS’ scenario to check if the specials item changes. Check that all the

other information also changes. In the example below, the transaction details were left the same

intentionally.

As mentioned in the ‘Manual Mapping’ section, you can rather use Adornments than the Expression builder to do test or data field decorations.

P a g e | 76

The ‘Notes’ Smart Part

Notes are used to insert drafting notes or comments why something was done in a certain way, into the document. These notes can be seen as ‘documentation’ for a template and can be handy if another template designer has to change a complex template. The Notes will not be present in the final document when it is composed.

You can add ‘Notes’ from the Smart Part group like any other Smart Part.

P a g e | 77

The ‘Optional’ and ‘Image’ Smart Parts

The ‘Optional’ Smart Part is used to mark a piece of text or data field as optional depending on a condition. The ‘Image’ Smart Part is used when working with images that can change depending on conditions met. Let’s use the ‘Optional’ Smart Part to display ‘This is what it looks like’ at the bottom of the statement document if the customer title is equal to ‘MRS’. Also add an ‘Image’ Smart Part to contain the image that will be different for MRS and MR.

P a g e | 78

Using the ‘Optional’ Smart Part

Select the ‘Optional’ Smart Part you created and then ‘Smart Part Properties’. Click on the Value drop-down. The Condition tab will be selected by default. Click on the … to add an ‘And’ condition.

P a g e | 79

Using the ‘Optional’ Smart Part Continued

Select the [@ClientDetail\].[Title] with the Equals comparison and type in the word MRS to compare title to. (This must look exactly as the Data in the scenario Title Field or in the database e.g. MRS MRS or e.g. Mr Mr )

Click ‘Save’ on the “Edit Optional Value” and ‘Save’ the Smart Part

TIP: Always save your work regularly!

P a g e | 80

Using the ‘Image’ Smart Part

Click on the tag under the “Smart Part” section to create a data element to contain the image that is going to be inserted into the statement document by using the ‘Data Schema’ command. Create the ‘SpecialsImage1’ field in the ‘Defaults’ Type with data type ‘Image’. (First create the ‘Defaults’ Type)

Using the ‘Mappings’ command and map the ‘Image’ smart Part to the SpecialImage1 data element you created.

P a g e | 81

Adding images to Scenarios

Open the ‘Scenarios’ command again and select your two test scenarios in turn. ‘Default’ Type should have been added automatically to your scenario, expand the Type and select the image data field you created, click on the ‘…’ to open up the ‘File Open’ dialog. Select a picture for each of your scenarios.

P a g e | 82

Adding images to Scenarios continued

Preview both the scenarios again to test the ‘Optional’ and ‘Image’ Smart Parts. The test scenario with the title as ‘MRS’ will display the optional line ‘This is what it looks like!’ and the ‘MR’ scenario will not display the line.

P a g e | 83

Adding images to Scenarios continued (2)

The images for both scenarios will also differ based on which image was selected for which scenario.

P a g e | 84

The ‘Reference’ Smart Part

The ‘Reference’ command allows you to design a DocFusion ® 365 template to call any other Word

document or DocFusion ® 365 Template on the local file system, DocFusion ® 365 server or SharePoint.

With this ‘Smart Part’, the final document can be built up from a combination of smaller documents used

as references. You can, for instance, reference a specific annexure across multiple templates, which

means that the annexure can be maintained in one place and not across all documents that contain that

annexure. This can also be used if certain parts of a document has to be maintained by different users

or departments.

Create a new Word document and call it AboutUs.docx and insert a line as below. Save the document

when done.

P a g e | 85

The ‘Reference’ Smart Part continued

Add a ‘Reference’ Smart Part at the bottom of your template document that will be configured to insert another Word document into your template document.

P a g e | 86

The ‘Reference’ Smart Part continued (2)

Select the ‘Reference’ Smart Part you have just created and click on ‘Smart Part Properties’ to configure the ‘Reference’ Smart Part. Click the ‘…’ on the ‘Reference Value’ to open the selection screen below and select “File Content”. Click on the ‘…’ to continue. “Please choose a file path” window will pop up, select the “Constant” tab and click on the “…”

P a g e | 87

The ‘Reference’ Smart Part continued (3)

The ‘File open’ dialog will now open. Navigate to where you saved the AboutUs.docx document (or whatever you have saved your document to be imported/referenced) and select it. Save all popups and they will close automatically.

Once the ‘Reference’ Smart Part has been configured, run the ‘Preview’ scenarios again to test and see

if the second document was inserted into your document.

P a g e | 88

The ‘Validate’ command

The ‘Validate’ command can be used to debug your template should it not construct when you use the

‘Preview’ command. A window will open up at the bottom of the template document. When you now run

the ‘Preview’, the window will output validation data and errors if applicable. You will notice that the

Address Line 2 that is suppressed when empty, produces an error. In this case, the ‘Collapse if value is

blank’ will ignore the error. You can highlight the line with the error on and click on the icon

to position the cursor on where the error was detected in your template document.

Use the icon to clear the ‘Validation Results’ window.

P a g e | 89

The ‘Hierarchy’ command

The Hierarchy window displays the ‘Schema Navigation’ window to the left of the document, allowing the user to navigate between existing Smart Parts created, and allowing the binding functionalities on each, to the data columns in the Data Type. You can also filter out (search) by typing the name of the Smart Part or Binding you are looking for. Use the icon to lookup the selected Smart Part in your template document. The icon can be used to inspect and edit the selected Smart Parts properties.

P a g e | 90

The ‘Toggle Markup’ command

The ‘Toggle Markup’ command displays the unique system ID (also referred to as a GUIDs) associated to each Smart Part in the template. These ID’s are automatically created by the system when a new Smart Part is created and is unique to each individual Smart Part. It allows an easy view of which text elements are already associated to a Smart Part tag. This can be used together with the ‘Validate’ command to debug errors.

P a g e | 91

The ‘Task Templates’ command

The ‘Task Template’ command allows you to create ‘Task Templates’ that will be accessible as a new adornment once saved. This is an advanced feature and allows you to create ‘Task Templates’ by combining existing adornments. This is useful if you often use the same combination of adornments to adorn a word or phrase. An example would be

Remove all ‘-‘ characters in a word

Turn the word into uppercase

Change the font to Italic

Bold the word

Click on the ‘Task Templates’ command to open the Task Templates Editor.

P a g e | 92

The ‘Task Templates’ Editor

Like all the other editors, you can Add, Edit and Delete Task Templates.

Click on the icon to add a new Task Template. Name the Task Template something appropriate e.g. RemoveDashUpperItalicBold. A Task Template needs ‘Parameters’, ‘Data Type’ and a ‘Default Value’. Add a ‘Template Parameter’ and an optional parameter description. This example will use a text string thus the ‘Data Type’ is set to ‘Text’.

P a g e | 93

The ‘Task Templates’ Editor – Adding a parameter

Name the ‘Template Parameter’ ‘Input Text’ and make sure the ‘Data Type’ is set to ‘Text’.

Click on the ‘…’ next to the ‘Default Value’ to change the default value to ‘Current Value’ under Task Variable. This means that the ‘Default Value’ will be the current value of the parameter passed into the ‘Task Template’.

Click on ‘Save’ and also ‘Save’ Add Template

P a g e | 94

The ‘Task Templates’ Editor – Adding a parameter continued

Your ‘Task Template’ has now been added with one input parameter of type ‘Text’.

The ‘Output Type’ is set to ‘Any’. For the operation to remove dashes, it will be required to change the text string’s size (smaller). Select ‘Text’ as the Output Type. If for example the text string only needed to be Bold, Italic and Red, an ‘Output Type’ of ‘None’ will be used, as the text string will not shrink or expand.

Click on ‘Save’

P a g e | 95

The ‘Task Templates’ Editor – Adding Configuration

The ‘Task Template’ now needs configuration. Click on the ‘…’ under ‘Configuration’. This will open the ‘Template Configuration Editor’.

Click on the Add icon . This will open up existing Adornments (and Task Templates if available) to choose from. Select the ‘Replace’ adornment. This adornment can be used to replace dashes with nothing (NONE) to remove them.

P a g e | 96

The ‘Task Templates’ Editor – Adding Adornments

Change the ‘Replace’ adornment’s ‘matches of’ to an underscore, and select “None”, this will open up the “New Value” window, make sure there is nothing in the text box under the “Constant” tab, and click on “Save”

The ‘Replace’ adornment will actually change the current value of the ‘Input Text’ string in size by removing underscores. Thus we need to reference the actual string and not the value. Click on ‘Current Value’, select ‘Task Variable’ and change it to ‘Input Text’. And Save

P a g e | 97

The ‘Task Templates’ Editor – Adding Adornments continued

Continue to add adornments to do the Uppercase, Italics and Bold (Font Weight). These functions will change the characteristics of the input text string, not the size thus ‘Current Value’ is used.

Click on ‘Save’. The ‘Task Template’ is now complete with a series of 4 adornments that will be called.

Close “Task Templates”

P a g e | 98

Adding a ‘Task Templates’ to a Data Field

‘Task Templates’ will appear under the ‘Adornments’ and can be added to a ‘Data Field’ just like an

adornment.

Create a new ‘Data Field’ in your template document and call it NameInsert. Add the newly created

‘RemoveDashUpperItalicBold’ Task Template as an adornment.

P a g e | 99

Testing ‘Task Templates’

Add another field to the ‘Default’ Type in the Data Schema for this test. In this example the ‘TrimDemo’ of type Text will be used.

Insert the word TrimDemo into your Word doc and make it a data field, map the ‘TrimDemo’ field to the data field that is in your ‘Default’ Type. You can use the ‘Smart Part Properties’ command or the ‘Mappings’ command.

P a g e | 100

Testing ‘Task Templates’ continued

Using the ‘Scenarios’ command, add data to the ‘Test Statement’ scenario using the ‘Default’ Type. Add a string with underscores that will be removed, turned to uppercase, bold and italic by the ‘Task Template’.

Click ‘Save’.

TIP: Always save your work regularly!

P a g e | 101

Testing ‘Task Templates’ continued (2)

Use the ‘Preview’ command to test the ‘Task Template’.

P a g e | 102

The ‘Queries’ command

The ‘Query Editor’ will open once you click on the ‘Queries’ command in the “Advanced” section. This

allows you to build certain condition specific queries that call certain values from the Types in the data

schema and populates the values in the document. The Query looks much like a SQL query and is also

an advanced function.

Click on the ‘Queries’ command to open the ‘Query Editor’.

P a g e | 103

Adding a Query

Select the icon to add a new query. Let’s design a query that will select transactions where the total amount is bigger than 50. Add a suitable name and Description

Click ‘Save’ to save the query name and description.

P a g e | 104

Adding a Query source

Click on the ‘Add Source’ command to add a source to the query. In our case, the source will be the ‘Transactions’ Type created in the data schema.

P a g e | 105

Adding a Query source continued

Select the Transactions source and click on ‘OK’ to continue.

Next click on the ‘where’ clause and select ‘Add Comparison’.

P a g e | 106

Add a “Where” clause to the Query

Click on the block below the where and select ‘Transactions1’ (make sure it is Transactions1). Then click after the ‘Transactions1 word to select the ‘Total’ field to compare. For the operator, select ‘>’ and finally enter a value of 50 after the comparison operator.

P a g e | 107

Testing a Query

Select any of your previously created scenarios and click the ‘Test Query’ command to test the query.

The Query Results window will now open and show the results of the query. Note that from the three

transactions setup in the ‘Test Statements’ scenario, only one where the Total value is bigger than 50

was selected.

P a g e | 108

Mapping a Query to your template document

Create another table at the bottom of your document like you created the “Transaction” Type before. The easiest way is to select ‘Transactions’ in the data schema and drag it onto your document. The Type will auto-create after you have selected the headings, columns and order. Use Word’s ‘Table Design’ tools to decorate the table as required. In the example, a simple red grid look was selected. This Complex Type will dragged into your document will be automatically a repeater.

P a g e | 109

Mapping a query continued

The new table created will have mappings to the ‘Transactions’ Type in the data schema. We want it to map to the result of the query created. Using the ‘Mappings’ command, map each of the new Complex Type fields to the Query fields created.

P a g e | 110

Mapping a Query continued (2)

The ‘Total’ field is a calculation. Use the ‘Manual Mapping’ and ‘Expression Builder’ to add an expression multiplying the newly created ‘Total’ and ‘Qty’ fields to calculate the total. Don’t forget to ‘Validate’ and ‘Evaluate’ your expression.

TIP: Always save your work regularly!

P a g e | 111

Mapping a Query continued (3)

The last thing to do is to make sure the Repeater created for the new Complex Type is mapped to the Query. Make sure the ‘Current Mapping Source’ is set to the Query name created, in this case ‘TotalBiggerThan50’.

P a g e | 112

Testing the mapped Query

Use the ‘Preview’ command to test the query with the scenarios created. You should see only the transactions with a total amount bigger than 50 appear in the red table.

Don’t forget to use ‘Adornments’ to format the date and amount fields.

P a g e | 113

The ‘Custom Functions’ command

The ‘Custom Functions’ command enables you to use an IDE Script / code development platform to add custom code or script to certain ‘Data Fields’ of the document that requires advanced functionality not available in the Smart Parts Properties. This is an advanced feature and requires programming knowledge in the C# language.

P a g e | 114

Adding a custom ‘Template Script’

The example below adds a custom function that will extract the customer name and surname out of the ‘ClientDetails’ Type. The data will be provided by the scenario that was created to test with.

Click on the ‘Compile’ command to compile the script. Check for any errors and correct. Click on ‘OK’ to save the custom script.

P a g e | 115

Mapping a ‘Custom Function’ script to a data field

Create a new placeholder text and add a ‘Data Field’ SmartPart. Select the SmartPart and click on the ‘SmartPart Properties’ command. In the ‘Bindings’ section, use the drop-down Value and select the DisplayNameAndSurname() script function. This will now bind the script to the data field. The script will execute at runtime and insert the retrieved customer name and surname.

P a g e | 116

Testing Custom Functions

Use the ‘Preview’ command again to test the created scenarios to validate that the ‘Custom Function’ script works.

P a g e | 117

Importing and Exporting

Most of the Editor windows (Data Schema, Queries, Scenarios, Task Templates) in the DocFusion ® 365 Designer allows you to Import or Export data in XML format. You can in this way, share snippets of functionality in your DocFusion ® Designer environment that you create in your templates that is re-usable. You can also import re-usable snippets created by other designers that you need without duplicating effort.

Removing Extensions and Uninstalling the DocFusion ® 365 Designer Before removing DocFusion ® 365 extensions or un-installing the DocFusion ® 365 Designer completely,

it is highly recommended that you first Export the Data Schema and any other work you might have done

on the template by using the Export features discussed above.

Click on the ‘Remove Extensions’ command on the ribbon to remove the DocFusion ® 365 extensions from your document.

Click ‘Yes’ to complete.

To completely remove the DocFusion ® 365 Designer from your computer, open the Control Panel >

Programs and Features and uninstall the DocFusion ® 365 Designer.