Menu

DOCX OUTPUT

Provides commands for printing data on DOCX documents.

Commands of this library may only be used in DOCX document content.

lock

A command whose content control and/or its contents can be locked. Locked content cannot be edited or deleted.

Attributes

title

Required
Value type
EL-evaluated
No String Yes
Defines the title of this command's content control when the Smart Content feature is enabled.

In undefined, the title is set to "lock". 
locked

Required
Value type
EL-evaluated
No Boolean Yes
If this attribute's value resolves into true, this command's content control cannot be deleted.

If undefined, the value true is used.
content-append

Required
Value type
EL-evaluated
No Boolean Yes
If this attribute's value resolves into true, document content within this command's content control cannot edited.

If undefined, the value true is used.
out

Replaces the contents wrapped by this command's content control with whatever text the value attribute resolves into. There are two special cases that cause this command to behave in different ways.

First case is that the evaluated value is a Map. In this case, instead of the Map being converted into text, all text content wrapped by the content control is combined into a key to retrieve a value from the map. Whatever the Map returns is then used as the output value instead of the Map.

Second case is that the evaluated value is a HTML Value. If this occurs, the HTML tags are transformed into DOCX properties and structures. However, the support for different tags is very limited at the moment. Also, please note that all original contents of the paragraph where this command's content control is in are deleted when handling a HTML Value, and only style-based formatting is transferred from the wrapped content to the output; any direct formatting is lost.

Attributes

value

Required
Value type
EL-evaluated
Yes Any Yes
Defines the text output of this command. The resolved value can be of any type - if the value is not a String, it is converted into one. Do note that values of certain types (such as Files) do not convert into very meaningful text content. 
required


Required
Value type
EL-evaluated
No Boolean Yes
Defines if this command is required to have a value to output. If this attribute's resolved value is true and the value attribute resolves into null, the user is informed with an error message.

If undefined, value of false is used, allowing value to resolve into null.
parser

Required
Value type
EL-evaluated
No String No
Specifies a Parser that converts the value to output into another kind of value. This occurs before formatting, so for example a String value representing a currency value could be first parsed into an actual Currency value, which could then be formatted by any Format handling currency values. The resolved String is expected to the name of a Parser defined earlier in the logic.
format

Required
Value type
EL-evaluated
No String No
Specifies a Format that takes the value to output and formats into a String as according to its formatting rules. The resolved String is expected to the name of a Format defined earlier in the logic.
locked

Required
Value type
EL-evaluated
No Boolean Yes
Defines if this command's content control is locked, which prevents it from being deleted. If the resolved value is true, the content control will be locked.
contentLocked

Required
Value type
EL-evaluated
No String Yes
Defines if this command's content control's contents are locked, which prevents them from being edited. If the resolved value is true, the contents will be locked.
title

Required
Value type
EL-evaluated
No String Yes
Defines the title of this command's content control when the Smart Content feature is enabled.
tagLogic

Required
Value type
EL-evaluated
No String Yes
Specifies the tag logic that will be executed right before the evaluation of this command. The resolved String is expected to be the name of a tag controller.
persistent

Required
Value type
EL-evaluated
No Boolean No
Defines if the command and its content control are to remain in the document content after evaluation, regardless of the document's Smart content status. This will be the case should the resolved value be true.  
color

Required
Value type
EL-evaluated
No String Yes
Defines the color that the command's output will take. The resolved String can be a hex color code preceded by a hash (eg. "#FFFFFF") or the name of a color.

The following color names are recognized:
Blue, White, Black, Gray, Red, Silver, Maroon, Olive, Yellow, Green, Lime, Teal, Aqua, Navy, Purple and Fuchsia

The names' interpretation is not case-sensitive, so both "red" and "RED" would be valid values.
table

Reconstructs the table this command's content control is wrapped around to reflect the provided container value, which is typically a Collection.

The command modifies the table by giving every item in the container a copy of the table's original non-header rows ie. content rows. So if the command's table has a header row and one content row with the value being a Collection with seven items, the result would have the header row with seven content rows. And if the table originally had two content rows instead, the end result would have 14 rows in addition to the header. To define header rows, set them as such through Word's table row properties ("Repeat as header row at the top of each page") or table styles ("Design" tab, "Table Style Options"). Static rows similar to the header rows may also be added to the bottom of the table by using this command's footerRows attribute.

The container value's items are iteratated through one by one, each getting a copy of the content rows created for it. Any commands within or wrapping the newly created rows are then evaluated. The item for whom the rows were created for is visible to the commands as the variable named with var. Header rows have their commands evaluated before the producing of content rows starts and do not have access to any special variables. Commands in footer rows are evaluated after all content rows have been produced and similarly have no special variables available for them.      

This command produces a local variable context that will be the active context for all commands within and around the table's rows.  

Attributes

value


Required
Value type
EL-evaluated
Yes
Any
Yes
Defines the container whose contents the command iterates through. While this container is primarily expected to be a Collection, two other types of types are also accepted.

The three types are handled in the following ways:
  • If the value is a Collection, table iterates through the items in it in their proper order.  
  • If the value is a Map, table iterates through its entries. The item of every round is therefore a Map entry that allows both the key and the value to accessed.
  • If the value is a Data Item, table performs just one loop round, with the Data Item being the item of the round.
If the value is a Collection or a Map that is empty, the command's table will be removed from the document.
var

Required
Value type
EL-evaluated
No String No
The value of this attribute defines the name of the local context variable that holds the current item of the loop.

If not defined, the name "row" is used for the item variable.
varStatus

Required
Value type
EL-evaluated
No String No
Defines the name of the variable that holds the loop status object. Loop status object has properties count, first, last and index. A new loop status is generated for every iteration of the loop. Note that count and index are not incremented if the iteration is skipped at onBeforeIteration-handler in the loop controller.

Property count is the number of the iteration starting from 1.
Property index is same as count with the difference that it starts from 0.
Property first is a Boolean true during first round of the loop.
Property last is a Boolean true during the last round of the loop.
footerRows

Required
Value type
EL-evaluated
Yes Integer Yes
Defines the amount of rows treated as footer rows, starting from the end of the table. Footer rows are treated like header rows, remaining below the generated rows and not cloned for each iterated item as the table is being evaluated. The value of this attribute and the amount of header rows in the table must not have a total that is equal to or greater than the total amount of rows in the table (in other words, there must be at least one content row).

If this attribute is left undefined, a default value of 0 is used, causing no footer rows to be present.
test

Required
Value type
EL-evaluated
No Boolean Yes
Defining this attribute makes the table a conditional element. If defined and the resolved value is false, the command's content control and the table will be removed. If the resolved value is true, or if the attribute is not defined, the command's content control and the table remain in the document and are evaluated normally.  
roundTest

Required
Value type
EL-evaluated
No Boolean Yes
This attribute can be used to define a condition for skipping certain iteration rounds. This attribute's expression is evaluated for every item in the local variable context, so the variable named with var holds the item. If the expression doesn't resolve into true, the current item is skipped, resulting in no copy of the content columns being produced.
locked

Required
Value type
EL-evaluated
No Boolean Yes
Defines if this command's content control is locked, which prevents it from being deleted. If the resolved value is true, the content control will be locked.
contentLocked

Required
Value type
EL-evaluated
No String Yes
Defines if this command's content control's contents are locked, which prevents them from being edited. If the resolved value is true, the contents will be locked.
title

Required
Value type
EL-evaluated
No String Yes
Defines the title of this tag's content control when the Smart Content feature is enabled.
logic

Required
Value type
EL-evaluated
No String Yes
Specifies the loop logic that will be executed during the evaluation of this tag. The resolved String is expected to be the name of a loop controller.
tableColumn

A special variant of the out tag that can alter the table column in whose header it is placed on. It behaves in the exact same way as out as far as producing output goes, so please see its documentation for details about special cases.

While tableColumn only reports an error if it is placed outside a table, it is essential that the tag is in a header row for the vMerge and test attributes' effects to work properly.

Attributes

value

Required
Value type
EL-evaluated
Yes Any Yes
Defines the text output of this tag. The resolved value can be of any type - if the value is not a String, it is converted into one. Do note that values of certain types (such as Files) do not convert into very meaningful text content. 
vMerge

Required
Value type
EL-evaluated
No Boolean Yes
Defines if adjacent cells on this column with the same text content will be merged. If the resolved value is true, merging is done to all adjacent content row cells whose text content is exactly the same after any tags within the cells have been evaluated.

If undefined or the resolved value is false, no merging is done.
test

Required
Value type
EL-evaluated
No Boolean Yes
Defining this attribute makes the column conditional. If the resolved value is false, the column will be removed from the evaluated table. If the resolved value is true or if the attribute is undefined, the column is not removed.

Note that any cell within a column that is made conditional through this attribute may not span horizontally across columns - if a horizontal span is detected, it will generate an error and the entire table is removed.
required


Required
Value type
EL-evaluated
No Boolean Yes
Defines if this tag is required to have a value to output. If this attribute's resolved value is true and the value attribute resolves into null, the user is informed with an error message.

If undefined, value of false is used, allowing value to resolve into null.
parser

Required
Value type
EL-evaluated
No String No
Specifies a Parser that converts the value to output into another kind of value. This occurs before formatting, so for example a String value representing a currency value could be first parsed into an actual Currency value, which could then be formatted by any Format handling currency values. The resolved String is expected to the name of a Parser defined earlier in the logic.
format

Required
Value type
EL-evaluated
No String No
Specifies a Format that takes the value to output and formats into a String as according to its formatting rules. The resolved String is expected to the name of a Format defined earlier in the logic.
locked

Required
Value type
EL-evaluated
No Boolean Yes
Defines if this tag's content control is locked, which prevents it from being deleted. If the resolved value is true, the content control will be locked.
contentLocked

Required
Value type
EL-evaluated
No String Yes
Defines if this tag's content control's contents are locked, which prevents them from being edited. If the resolved value is true, the contents will be locked.
title

Required
Value type
EL-evaluated
No String Yes
Defines the title of this tag's content control when the Smart Content feature is enabled.
versionNumber

A special variant of the out command for printing a version number that comes with specific predefined values for some of its attributes. It behaves in the exact same way as out, so please see its documentation for details about special cases.

When inserted into a template, the following attributes have their values predefined:

  • value is "${versionNumber}"
  • title is "versionNumber"
  • persistent is true

As can be seen, the predefined value refers to a variable called "versionNumber". It is up to the logic preceding the evaluation of this command to create that variable.

Attributes

value

Required
Value type
EL-evaluated
Yes Any Yes
Defines the text output of this command. The resolved value can be of any type - if the value is not a String, it is converted into one. Do note that values of certain types (such as Files) do not convert into very meaningful text content. 
required


Required
Value type
EL-evaluated
No Boolean Yes
Defines if this command is required to have a value to output. If this attribute's resolved value is true and the value attribute resolves into null, the user is informed with an error message.

If undefined, value of false is used, allowing value to resolve into null.
parser

Required
Value type
EL-evaluated
No String No
Specifies a Parser that converts the value to output into another kind of value. This occurs before formatting, so for example a String value representing a currency value could be first parsed into an actual Currency value, which could then be formatted by any Format handling currency values. The resolved String is expected to the name of a Parser defined earlier in the logic.
format

Required
Value type
EL-evaluated
No String No
Specifies a Format that takes the value to output and formats into a String as according to its formatting rules. The resolved String is expected to the name of a Format defined earlier in the logic.
locked

Required
Value type
EL-evaluated
No Boolean Yes
Defines if this command's content control is locked, which prevents it from being deleted. If the resolved value is true, the content control will be locked.
contentLocked

Required
Value type
EL-evaluated
No String Yes
Defines if this command's content control's contents are locked, which prevents them from being edited. If the resolved value is true, the contents will be locked.
title

Required
Value type
EL-evaluated
No String Yes
Defines the title of this command's content control when the Smart Content feature is enabled.
tagLogic

Required
Value type
EL-evaluated
No String Yes
Specifies the tag logic that will be executed right before the evaluation of this command. The resolved String is expected to be the name of a tag controller.
persistent

Required
Value type
EL-evaluated
No Boolean No
Defines if the command and its content control are to remain in the document content after evaluation, regardless of the document's Smart content status. This will be the case should the resolved value be true.  

Comments

0 comments