Common:Processing Related Records in MS Office
From AgileApps Support Wiki
Revision as of 21:29, 23 June 2015 by imported>Aeric
For HTML, you insert related records into a table by putting loop-controls around code that specifies a single row:
- #foreach($i in $Order_Items)
- <tr>...row contents here...</tr>
- #end
The problem in MS Word is that there is no place "outside the row" to put those 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.
- Between them, include the field that will be displayed in the cell
- Each construct is inserted as a field in the cell (Insert > Quick Parts > Field)
- 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