On this page Column-wise repeat of data over a collection
|
The Form level attribute Repeat is used to repeat data of a collection column-wise in the reports created using productivity suites, using the function TplColumnObject .
Syntax
Repeat : <Token Name> : <Collection Name>
Where,
<Collection Name> is the name of the collection or a sub-collection.
<Token Name> is the name of the token specified in the document template for evaluating the value using the attribute XML Map .
Function TplColumnObject evaluates the given parameter in the context of the column object. In the absence of this function, the expression is evaluated in the current context of the Report .
Syntax
$$TPLColumnObject:<Expression>
Where,
<Expression> can be any expression which evaluates to any data type like, string, number, amount, and so on.
Example
To print ledger names as columns:
● Design the document template as shown below:
$LedName |
Token is specified in one cell, based on the number of objects in the collection, the columns are added.
● Add the below code snippet in the required TDL.
[Form : Sample Report]
XML Map : LedName : @@TPLColObjName
Repeat : LedName : LedgerColl
[System : Formula]
TPL ColObjName : $$TPLColumnObject:$Name
[Collection : LedgerColl]
Type : Ledger
The output appears as shown below:
Ledger1 |
Ledger2 |
Ledger3 |
In this example, the collection includes three ledgers. All the three ledgers are added as columns.