Cell prefix: spans and tables

There are several options when working with
Contract Express
mark-up in a table that primarily depend on what you want to achieve in the generated document.
Spanning single rows
If your span covers an entire row in a table,
Contract Express
will treat the whole row as conditional: if the condition evaluates to false, the whole row will be removed from the generated table. Let us consider the second row in this table, for example:
Description
Variable name
Name
{BuyerName}
[
AddAddressInfo
Address
{BuyerAddress}]
Telephone
{BuyerTelephone}
if AddAddressInfo is answered as No then
Contract Express
will remove the whole of the address row from the generated document:
Name
ABC Corp
Telephone
1 800 569-2430
This is often used for Repeats too:
Customisation Description
Cost
[
Repeat CustomisationNumber
{CustomisationDescription}
]
{CustomisationCost}
Spanning Multiple Rows and table breaks
If your span (including a repeat span) contains multiple rows, you must separate these rows from the rest of the table and use a table break. To do this first separate the rows into their own table and then in the paragraph before your spanned rows, add the text "Start Table Break". Then use Insert Span to add a false condition around this text. Finally after your rows and before the rest of the table, add text for "Finish Table Break" and also add a false condition around that text. In our example, the AddAddressInfo span covers 2 rows and therefore we have to separate these rows and use table break accordingly:
Name
{BuyerName}
[
False
Start Table Break]
[
AddAddressInfo
Address
{BuyerAddress}
{BuyerSecondAddress}]
[
False
Finish Table Break]
Telephone
{BuyerTelephone}
The conditionals around the table break spans will evaluate to false and therefore be removed in the generated document thereby joining up your separate tables as intended.
Cell prefix and conditional columns
There are two possible interpretations when a span covers a complete cell in an MS Word table, and the business rule associated with the span evaluates to false. Either the cell remains in the table but with empty contents or the cell is removed from the table.
This ambiguity is resolved by prefixing the business rule with the keyword
Cell
. With this prefix the cell will be removed from the table; without the prefix the empty cell will remain in the table.
This is often useful for making columns optional. By putting the Cell prefix in all cells in the column, you then make the column conditional: a 3 column table in the template document could become a 2 column table in the generated document if the third one is not needed.
For example, in the following table:
Name
[
Cell BuyerType IsNot "Individual"
Registration Number]
Address
{BuyerName}
[
Cell BuyerType IsNot "Individual"
{BuyerRegistrationNumber}]
{BuyerAddress}
If
BuyerType
is "Public Limited Company" then both cells will remain in the table:
Name
Registration Number
Address
Alpha Holdings
AH/123
Alpha House, Alpha Road, Alphaton
whereas if the
BuyerType
is an "Individual" then both cells will be removed giving the appearance that the central column of the table is removed:
Name
Address
Jane Doe
21, Station Road, Southwold
If the span mark-up had not been prefixed with the keyword
Cell
then the resultant table would have been:
Name
Address
Alpha Holdings
Alpha House, Alpha Road, Alphaton

Repeated cells

The
Cell
prefix can also be used for repeated spans enabling MS Word table cells, rather than their contents, to be repeated. In this way you can add as many columns to the table as is defined in the repeat context.
For example:
Company
[
Cell Repeat DirectorCount
Director #{RepeatCounter}]
{CompanyName}
[
Cell Repeat DirectorCount
{DirectorName}]
If the company Alpha Holdings has directors John, Jane and Eva then the resultant table will be one column per Director:
Company
Director #1
Director #2
Director #3
Alpha Holdings
John
Jane
Eva

See Also

Repeat Spans