|
Tip>Designer |
|
|
Block commands in tables |
|
|
Article #: |
0010 |
|
Contributor: |
Peter Ottermann |
|
GF version: |
All |
|
Applies to: |
Document Logic in tables |
|
Last updated: |
July 2, 2001 |
Description
Document Logic block commands in tables do not support the repetition of partial rows. Depending on how the block commands are positioned, this can affect the logic of previous tasks.
Explanation
When nesting Document Logic tasks in tables, remember that block commands will affect an entire row in a table if the block spans more than one cell. If part of the logic of previous tasks is deleted, the result can be an infinite loop.
There are a few simple rules to follow. Click here to view the rules.
Never place any commands between the EndBlock FillPoints of two or more Document Logic tasks if one of them is a DeleteBlockIf or a KeepBlockIf task. If you do, the command will not be executed if the block is removed and this will affect the logic in the first Document Logic task.
Use different variables in the conditions set in the Document Logic parameters.
Update variables before the DeleteBlockIf or KeepBlockIf task.
For example:
|
PRODUCT |
QUANTITY/PRICE |
DESCRIPTION |
|
%[RepeatBlockWhile(y>0)] %[x=y]%[y=y-1] %[DeleteBlockIf(x=2)] %[Product] |
%[Qty] %[Price] |
%[Description] %[EndBlock()] %[EndBlock()] |
More Examples
The examples below describe how to use Document Logic tasks in a table to produce a specific outcome.
|
NOTE |
|
The blocks in the table that will be affected by the logic are highlighted in blue. |
Example 1: The logic affects an entire table.
Place the FillPoints at either end of the table (outside the table) or in the first block and the last block of the table.
%[DocumentLogictask()]
|
QUANTITY |
PRICE |
|
%[Qty] |
%[Price] |
|
%[Qty] |
%[Price] |
|
%[Qty] |
%[Price] |
%[EndBlock()]
|
%[DocumentLogictask()] QUANTITY |
PRICE |
|
%[Qty] |
%[Price] |
|
%[Qty] |
%[Price] |
|
%[Qty] |
%[Price]%[EndBlock()] |
Example 2: The logic affects several rows.
Place the first FillPoint in any cell in the first row to be affected. Place the EndBlock FillPoint in any cell in the last row to be affected.
|
QUANTITY |
PRICE |
|
%[Product] |
%[Description] |
|
%[DocumentLogictask()]%[Qty] |
%[Price] |
|
%[Qty] |
%[Price] |
|
%[Qty] |
%[Price]%[EndBlock()] |
Example 3: The logic affects a single row.
Place the FillPoints in any two cells in the row.
|
QUANTITY |
UNIT PRICE |
TOTAL PRICE |
|
%[DLtask()] %[Qty] |
%[Unit]%[EndBlock()] |
%[Price] |
|
%[Qty] |
%[Unit] |
%[Price] |
|
%[Qty] |
%[Unit] |
%[Price] |
In the case of a single column table, place the first FillPoint in the row to be affected. Place the EndBlock FillPoint at the beginning of the following row.
|
PRODUCT DESCRIPTIONS |
|
%[DocumentLogictask()]%[Description] |
|
%[EndBlock]%[Description] |
|
%[Description] |
Example 4: The logic affects the contents of a single cell.
Place both FillPoints in the cell.
|
QUANTITY |
UNIT PRICE |
TOTAL PRICE |
|
%[DLtask()] %[Qty] %[EndBlock()] |
%[Unit] |
%[Price] |
|
%[Qty] |
%[Unit] |
%[Price] |
|
%[Qty] |
%[Unit] |
%[Price] |
Example 5: The logic affects the last row or group of rows.
Place the first FillPoint in any cell in the first row to be affected. Place the EndBlock FillPoint after the table.
|
QUANTITY |
UNIT PRICE |
TOTAL PRICE |
|
%[Qty] |
%[Unit] |
%[Price] |
|
%[DocumentLogictask()] %[Qty] |
%[Unit] |
%[Price] |
|
%[Qty] |
%[Unit] |
%[Price] |
%[EndBlock()]
Example 6: The logic affects the rows in a table that has been inserted into another table.
Place the FillPoints in any two cells in the inserted table.
|
PRODUCT |
QUANTITY/PRICE |
DESCRIPTION | ||||||
|
%[Product] |
|
%[Description] |
If the one FillPoint is placed in the inserted table and the other is placed in the main table, the logic will affect the main table.
|
PRODUCT |
QUANTITY/PRICE |
DESCRIPTION | ||||||
|
%[Product] |
|
%[Description] %[EndBlock()] |