Table Tags in Docomotion include scripts that implement various logic, such as showing or hiding specific table rows, sorting tables, setting row ranges, and adding page breaks. Below are detailed instructions on utilizing these features:
Hide/Show Table Rows (row-level filtering)
Use a script on a dynamic table to include only the rows that meet your condition at generation time.
- In the Form pane, right-click the table (blue T) and choose Properties.
- Click New to open the Script Editor.
- Add HIDE ROW() as the first statement.
- Add an If with your row condition, then SHOW ROW().
- Save the script and click OK in Table Properties.
- Example – show only items with a positive Total Price
- HIDE ROW()
- If (QuoteLineItems/Total Price > 0 )
- SHOW ROW()
Hide/Show Table Rows in Grouped Table
For grouped tables, scripts can show/hide specific rows or the entire table. Follow these steps:
- Right-click the parent Group Table tag (red ‘G’ tag) in the Data Tags/Form pane and select Properties.
- In the Table Properties window, click New to access the Script Editor.
- Under Table Actions/Visual, select HIDE ROW/SHOW ROW or HIDE GRAPHICAL ROW/SHOW GRAPHICAL ROW based on your requirement.
- If you choose SHOW or HIDE GRAPHICAL ROW, select the row. For example, show row 1 if Asset ID=1000 or hide row 3 if Description=EMPTY.
- Save the script and click OK in Table Properties.
Sorting Tables
Docomotion supports sorting dynamic tables at runtime with up to three sorting levels. Here’s how to add a sorting script:
-
- In the Form pane, right-click the table (blue T) and choose Properties.
- In the Table Properties window, click New to open the Script Editor.
- Under Table Actions/Visual, double-click SORT TABLE.
- In the Sort Table window, select the data tag for sorting, type (text, Number, or date), and sorting direction (Ascending or Descending). You can add two more sorting levels.
- Save the script and click OK in Table Properties.
Setting a Row Range
Row Range limits the number of Salesforce rows being render in the table output.
Only the rows within the range will be printed; all other rows from the data source are suppressed.
Indexing is 1-based (the first data row is 1) and the range follows the table’s current sort order (if you sorted the data, the “first” row means the first after sorting).
Examples
1 → render only the first row from Salesforce.
1–3 → render rows 1 through 3 (inclusive).
Define the output rows for a Salesforce table using a script:
-
- In the Form pane, right-click the table (blue T) and choose Properties.
- In the Table Properties window, click New to open the Script Editor
- Double click the SET ROWS RANGE
- Set the range according to your needs
- Save the script and click OK in Table Properties.
Adding Page Breaks
Scripts can be created to add page breaks in the output for a dynamic table. Here’s how:
-
- In the Form pane, right-click the table (blue T) and choose Properties.
- In the Table Properties window, click New to open the Script Editor.
- Under Table Actions/Behavior, click INSERT PAGE BREAK.
- Save the script and click OK in Table Properties.
Adding Page Breaks in Grouped Table
For grouped tables, scripts can be used to add page breaks. Follow these steps:
- Right-click the parent Group Table tag (red ‘G’ tag) in the Data Tags/Form pane and select Properties.
- In the Table Properties window, click New to access the Script Editor.
- Under Table Actions/Behavior, select INSERT PAGE BREAK BEFORE or INSERT PAGE BREAK AFTER.
- Save the script and click OK in Table Properties.