Using Variables in Word Publishing

Navigation:  Publishing >

Using Variables in Word Publishing

Previous pageReturn to chapter overviewNext page

Available Merge Fields

You can use up to 256 fields overall, including those used in In-Row Documents or in In-Row Workbooks.

To preselect them, click Data>Merge fields.

Three prefixes are available:

GLV_ (refer to Global Variables)

SYS_ (ibidem)

ROW_, for fields whose value depend on the current Minute row.

 

In the General Settings

The IncludeMinutes setting can be a user global variable (wrapped by quotes); then it can be changed outside Word.

In the Letter form

To insert Global variables in the Letter form, select Word>Create External Document; this creates an empty Word™ document whose source of data is QDV7's data manager; as the menu Mailings is already selected, to compose your letter, just click Insert Merge Field (icon or caption) and select the global variables.

Examples: SYS_Version_Letter, SYS_File_Creation_Date; the grand total in words can be calculated in the Overhead workbook and used thru a GLV_ variable. Refer to Consumption of Variables.

 

In the WBS and the Minutes In-Row Documents

Global Variables can be inserted in Word. Refer to In-Row Documents. The values display in the resulting document after the related rows.

 

Conditional Insertion/Removal

To remove a sub-section of the master document according to the value of a global variable, bookmark the sub-section, and insert a table like this one:

Remove bookmarks

 


Variable Name

Value

Bookmark Name

GLV_Contact_name

ABC

TESTSHOWHIDE

SYS_Lang_UI

FR

ENGLISHCUSTOMERONLY

This way it is possible to remove from the boilerplate parts written in another language.

 

To insert an external document according to the value of a global variable, insert a bookmark in the master document at the desired insertion point, and insert a table like this one:

Insert bookmarks

 



Variable Name

Value

Bookmark Name

File path

GLV_InsertSalesConditions

YES

SALESCONDITIONS

..\Samples\Word_Documents\Terms_And_Conditions.docx

When the condition is not fulfilled, the related bookmark is just removed.

 

The time when the document is inserted / the bookmarked sub-section is removed depends on general settings ProceedWithInsertion/RemovalOfBookmarks. Refer to the end of How to Build a Master Document (Template).

 

Ranges from BoQ and Overhead Sheets

Suppose an area in BoQ or Overhead workbook is named. Refer to Range of Cells.

To associate it to a bookmark, create a table like this one:

Source Workbooks

Variable Name

Value

Workbook

Name

Bookmark Name

Fit to Page Width

Adjust Row Height

GLV_InsertArea1

YES

OVERHEAD

AREA

INSERTRESULT

NO

NO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

When the resulting document is created/refreshed, a table with the size and content of the range is inserted right after the bookmark, which is hidden.

To conditionalize the insertion, fill out the two first columns (optional); if the variable contains the expected value, the area is inserted.

To automatically adjust the width of inserted cells so that the table expands to the page width, set Fit to Page Width to YES.

To adjust row heights so that the whole text is visible, set Adjust Row Height to YES. When it is set to NO, row heights remains as they are in QDV7.

NOTES

- Microsoft Word cannot reproduce exactly all formats available under Microsoft Excel. Some restrictions apply on orientation, typeface, colors, etc. Carry out some tests to make sure it is rendered the way you want. The function doesn’t copy images, shapes or GUI widgets; a table is created in Word where the cell contents are copied-pasted

- To preserve high performance, do not refer to areas with more than 2,500 cells

 

Documents from Set Databases

The document attached to the set can include variables.

1.Refer to How to Fill out the Fields of the List of Articles

2.Exit the edit mode and insert the set into the Minutes; in the column Word document, x displays in the header row

3.Click Data>Word>Manage documents and create the final document; the merged document displays after the header row

4.To change the document, select the minute and click Data>Edit in-row Document

 

LANGUAGE BOOKMARKS What is said in How to Build a Master Document (Template) applies.

COMBINATION WITH CONTROLS

The value of a variable can result from a calculation inside the set.

The in-row document can conditionalize parts through a setting part much like a master document:

In the first part, a table associates bookmarks, i.e. parts, to variables defined in the Sheet3 of the List of Articles. These variables can take values returned from GUI Widgets and dependent on the selection in the form. The set database in <installation folder>/Samples/databases_of_sets gives an example; the pictures are inserted depending on variables, whose values depend on the selection in the form.

The first part is removed after insertion. The global variables are not replaced until the final document is published.  

Set_Main_document

INSERTION OF WORKBOOK AREAS

To insert an area of the workbook into the Word document, insert a bookmark where it will go (second section) and create a table like this one in the first section of the document:

Workbooks Areas

Area Name

Bookmark Name

Fit to Page Width

Adjust Row Height

DEMOAREA

INSERTDEMOAREA

YES

YES

 

 

 

 

 

 

 

 

 

To automatically adjust the width of inserted cells so that the table expands to the page width, set Fit to Page Width to YES.

To adjust row heights so that the whole text is visible, set Adjust Row Height to YES. When it is set to NO, row heights remains as they are in QDV7.

Example: in the set database in <installation folder>/Samples/databases_of_sets.

 

Formatting of Currencies and Dates

Refer to Formatting of Global Variables in Word.