Help ELMA ECM+
×
Menu
 

Document Templates

Document templates are used to automatically create document versions, based on the filled document fields or business process variables.
You can use the following file types as a template: .rtf, .txt, .doc, .docx, .xls, .xlsx, .xml, .html.
Document template is a file, which includes the static and dynamic parts. Static part does not change, while the dynamic part contains variable names, whose values are generated from the document attributes or process context variables.

Template syntax

A document template can include text, names of document type attributes and of context variables. All the variables in the template look like that:
{$variable_name}
Variable name is the unique name of the variable. It can be a document attribute name or a context variable name.
You can use any document attribute of process variables of any data type in a document template. Keep in mind, that all the variables, regardless of their data type, are converted into the String data type for correct display in the template.
Using blocks
If you need to use a context variable or document attribute of the Block type in the template, then the syntax of such a variable in the template looks like that:
{for Item in {$variable_name}}
{$Item.property1_name} {$Item.property2_name} {$Item.property3_name}
{end}
property_name – name of property of block type context variable.
After the document is generated by this template, the block properties will be written one after another.
Using conditions
Condition starts with {if } and ends with {end}. You can use {end if} instead of {end}.
<condition> - any condition, e.g. {$variable_name}=true.
{else} - allows performing an action, if the condition is false.
Condition structure:
{if }
< Action, if the condition is true>
{else}
< Action, if the condition is false>
{end}
Display of date and time in a specified format
For the date and time to display correctly in a template, you must add a context variable of the Date/Time type. The syntax of this variable will look like this: {DateTimeFormat({$Date}; ‘dd –MM –yy , H:mm:ss’)}, where:
dd –MM –yy - data display format;
H:mm:ss – time display format.
Display of numbers in a specified format
For correct display of number in the required format, use the following syntax: {NumberFormat(2345.6789;2)}, where:
2345.6789 – number display format;
2 – number of decimal places.
Numbers are generated in a document without creating a context variable.
Display of money in a specified format
For correct display of money in a specified format, use the following syntax: {MoneyFormat(2345.6789;2)}, where:
2345.6789 – number display format;
2 – number of decimal places.
Numbers are generated in a document without creating a context variable.

Creating a template

To create document template, you have to:
You can upload a document template to the system from local PC or you can use an ELMA document.
Fig. 1 illustrates an example of a document template.
Fig. 1. Example of a document template
You can use a document template when:

Using a template when creating a document

To be able to use a template for generating a document, when creating a document version, you have to:
You can add several templates for each document type.
When creating/editing a document of this type, the Add Template button will be added to the Versions unit (fig. 2)..
Fig. 2. Document page. Add Template button
When you click on this button, you have to select the template for generating a document version (fig. 3).
Fig. 3. Selecting a document template
After that, the document version will be generated according to the selected template. Fig. 4 shows an example of a document version, generated from a template. The selected text is generated by using the document attributes.
Fig. 4. Document version, generated from a template
To save the registration variant, click Save.

Using a document template in a business process

To be able to automatically generate a document version as part of a business process, you have to use the Generate Document Version activity. To learn more about the activity, see the respective Help page.

Copyright © 2006–2019 ELMA