Common:Processing Related Records in MS Office

From AgileApps Support Wiki
Revision as of 21:49, 26 July 2013 by imported>Aeric (Created page with "<noinclude>__NOINDEX__</noinclude> 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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($d in $developers)
     <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($d in $developers)
  • @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
Example
«@before-row#foreach($d in $developers)»
«
$d.Name»
«
@after-row#end»

Learn more: Solution: use @before-row @after-row