2020.2

Table Of Contents
Wrapping elements in a box (see "Boxes" on page676) or in a semantic HTML element makes
it easier to target them in a script or in a style sheet. Place the cursor in the element or select
multiple elements. Then, on the menu, click Insert > Wrap in Box. You can now use the
wrapper element as a script's or style's selector; see "Using the Text Script Wizard" on
page788 and "Styling and formatting" on page726.
The Text Script Wizard has an Expand button that opens the Script Editor, where you can edit
the code or add your own. (For an introduction, see "Writing your own scripts" on page853).
When you double-click on the Invoice Meta script, the Script Editor opens immediately. This
script shows how to add data using the replace() method (see
https://www.w3schools.com/jsref/jsref_replace.asp).
Note that this is a native JavaScript function. Functions that are only available in Designer
scripts are listed in the "Designer Script API" on page1265.
Dynamic Table
The table in the invoice is a Dynamic Table. It is filled and expanded dynamically by the scripts
in the Products folder. To learn how to insert and edit such a table, see "Dynamic Table" on
page801.
Note that this table does not use one of the default table styles, and that the style sheet with the
default table styles is not present in the template. To add that style sheet to the template, insert
a table using the Dynamic Table wizard.
The data mapping configuration
The template is merged with data from an XML file: Sample Data.xml. They are extracted from
the XML file with a data mapping configuration, made with the DataMapper (see "The
DataMapper" on page196).
The data mapping configuration first extracts the common invoice fields, and then the
transactional data, in a loop. For information about how to extract transactional data from an
XML file, see: "From an XML file" on page237.
Of course, this will only work with the appropriate data files. This data mapping configuration
was designed for XML files that are structured like this the sample file: Sample Data.xml.
It is located in the Configurations\Data folder, but you will also see it when you open the data
mapping configuration itself: select File > Open from the menu; browse to the
Configurations\Resources folder and select the data mapping configuration: PR_TRAN Data
XML.
Page 164