Common:Processing Related Records in MS Office
From AgileApps Support Wiki
Revision as of 21:26, 23 June 2015 by imported>Aeric
When processing related records, you generally want to insert rows into a table. In HTML, you would do that by putting the loop-controls around an individual row:
- #foreach($i in $Order_Items)
- <tr>...row contents here...</tr>
- #end
The problem is that, in MS Word, there is no place "outside the row" to put the loop controls.
The solution is to use two special constructs that go into the first cell of the row:
- @before-row#foreach($i in $Order_Items)
- @after-row#end
- Considerations
-
- The constructs only need to be specified once in the row, in the first cell.
- Each construct is inserted as a field in the cell (Insert > Quick Parts > Field)
- Between them, include the field that will be displayed in the cell
- For other cells in the row, specify the field to include in that cell, without the extra constructs
- Example
- Cell 1:
- «@before-row#foreach($i in $Order_Items)»
«$i.unit_price»
«@after-row#end»
- «@before-row#foreach($i in $Order_Items)»
- Cell 2:
- «$i.quantity»
Learn more: Solution: use @before-row @after-row