2022.1

Table Of Contents
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918).
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1341.
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
page866.
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221).
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267.
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.
Print settings
A Print context and Print sections can have their own print settings (see "Print settings in the
Print context and sections" on page515). The only print setting that the Print section has in this
template, is the Duplex setting. (Right-click the section and select Sheet Configuration. See
also: "Sheet Configuration dialog" on page1084.)
Page 168