@@Table/@@EndTable
Use an @@Table/@@EndTable pair when you want to insert a table with columns based on the nodes in a dataset. Alway place @@Table/@@EndTable inside a @@Begin/@@EndRepeat pair in order to properly generate columns from the dataset nodes. The number of columns generated for the table equals the group by count parameter in the @@BeginRepeat statement. If there are more nodes than your group by count parameter, the table repeats with the additional nodes as columns in the new table.
Warning: Do not use @@DefineIf in combination with @@Table.
Syntax:
@@Table(<RowCollection>)
Col 1, Row 1 |
Col 2, Row 1 |
Col 1, Row 2 |
Col 2, Row 2 |
@@EndTable
Parameters:
An optional parameter that identifies a collection of nodes to be used to generate body rows in the output table.
A two-row, two-column table that serves as the template for the table created by the statement. The generated table inherits the look and feel of this template (row shading, table text font and face, etc.).
The template for the first column header. You can format this cell using any of Word's table formatting features. The width you set for this column is preserved when generating the table in the document.
The template for the first column table body. You can format this cell using any of Word's table formatting features. The width you set for this column is preserved when generating the table in the document.
The template for the node column header. Node columns are generated for each node in the repeat. The width for you set for this column is the total width of all node columns. Node columns are equally divided into the width you set. You can format this cell using any of Word's table formatting features.
The template for the node column body. Node columns are generated for each node in the repeat. The width for you set for this column is the total width of all node columns. Node columns are equally divided into the width you set. You can format this cell using any of Word's table formatting features.
Additional Notes:
- The number of columns in the table equals the GroupByCount in the repeat.
- You can use the subscript [i] as a placeholder for the RepeatIndex in the Repeat. Never use the subscript in column 1 of the table template.
- If you include the RowCollection parameter, you can use the subscript [j] as a placeholder for the RepeatIndex of the RowCollection. Never use the subscript in row 1 of the table template.
- You can have multiple templates within the @@Table. The templates are merged into a single table when the document generates.
- You can use @@IncludeIf/@@End within @@Table to conditionally include rows.
- You can use @@BeginRepeat/@@EndRepeat in a table template @@Table to dynamically generate rows based on the nodes in the specified repeat token.
- Any text inside @@Table but outside a table cell is ignored, except for @@IncludeIf/@@End, and @@BeginRepeat/@@EndRepeat.
Example:
Code:
@@BeginRepeat(#Options.Option, 3)
@@Table()
Plan Description |
Option #Options.Option[i].RepeatIndex |
Plan Description |
|
Coverages |
@@if(#Options.Option[i].SpIsIncluded = ‘Y’, #SpCoverage, ‘ ‘) |
Annual Specific Deductible @@If(#Terms.SpIsFamilyDeductible = ‘N’, ‘per Individual’, ‘per Family’) |
@@If(#Options.Option[i].SpIsIncluded = ‘Y’, @@Format(#Options.Option[i].SpDeductible, '$ #,###,##0'), ‘ ‘) |
@@IncludeIf(@@Count(#Laser.Deductible.Individual) > 0)
Except for |
|
@@BeginRepeat(#LaserDeductible.Individual)
#LaserDeductible.Individual.Name |
@@if(#Options.Option[i].SpIsIncluded = ‘Y’ And #LaserDeductible.Individual.SpDeductible > #Options.Option[i].SpDeductible, @@Format(#LaserDeductible.Individual.SpDeductible, ‘$ ###,##0’), ‘ ’) |
@@EndRepeat
@@End
@@EndTable
@@EndRepeat
Output:
Plan Description |
Option 1 |
Option 2 |
Option 3 |
Plan Description |
|
|
|
Coverages |
Medical, Rx SAAO |
Medical, Rx SAAO |
Medical, Rx SAAO |
Annual Specific Deductible per Individual |
$ 100,000 |
$ 120,000 |
$ 140,000 |
Except for |
|
|
|
Smith, John |
$ 125,000 |
$ 125,000 |
|
Lincoln, Abraham |
$ 143,000 |
$ 143,000 |
$ 143,000 |