Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Limitations when used in Microsoft Office Word document

You cannot use multi-line statements in different objects. If you try to use them in DOCX, an error message will open. See the following example.

Invalid Usage of Multi-line Statement in DOCXImage Modified

...

Image Modified

The Error Message of Invalid Usage of the Multi-line Statements in DOCX.

Creating data for multiple columns

...

Template Code:

#forrow($p in $sPackage) $p$p.name#forcol($o in $sorter.sort($p.ownedElement))
$o$o.name#endcol#endrow

Output:

 

Warning

#forcol must be defined as the first statement in a column because it is parsed and processed before other statements in the column except #forrow. See the example below.

...

Name#set($p = $Package) #forcol($ap in $p)
$ap$ap.name#endcol

Above code will be parsed to 

Name#forcol($ap in $p) #set($p = $Package)
$ap$ap.name#endcol

Output:

So, the template code should be:

...

Name#set($p = $Package)#forcol($ap in $p) $ap$ap.name#endcol

Output:

Info

#forcol will create dynamic columns in a row. This directive does not create columns for the whole table. See the example below.

...

Project $tableprop.mergeColumns($Package.size())Packages
#forcol($p in $Package)$p$p.name#endcol


2. $tableprop.mergeColumns(String stringNumber)

...

Project$tableprop.mergeColumns(“3”) Packages
#forcol($p in $Package)$p$p.name#endcol

Output:

Info

$table.mergeColumns() must be defined as the first statement in the column because it is parsed and processed before other statements in column expect #forrow and #forcol. See the example below.

...

Project#set($gValue = $Package.size() +
1)$tableprop.mergeColumns($gValue)Packages
#forcol($p in $Package) $p$p.name#endcolNo Package

Above code will be parsed to 

Project $tableprop.mergeColumns($gValue)
#set($gValue = $Package.size() + 1)Packages 
#forcol($p in $Package) $p$p.name#endcol name#endcol No Package

  Output:

 

So, the template code should be:

...

Project#set($gValue = $Package.size() + 1) $tableprop.mergeColumns($gValue)Packages
#forcol($p in $Package)$p$p.name#endcol name#endcol No Package

Tip

$tableprop.mergecolumns() will make a column to be a merged column, it does not change the number of columns in a row. See the following example.

...

$tableprop.mergeColumns(“5”)Packages  
#forcol($p in $Package)$p$p.name#endcol  

Output:

The number of columns in the first row is still 3.