Table macros in Word 365 templates

This macro for Docuo templates in Word allows you to display the data of one or more “child” documents of another category in a table.

Table macros in Word templates are only available in Docuo Enterprise.

For example, if we have two categories: “Invoices” and “Invoice lines” related to each other through a drop-down list, we can create a Word 365 Invoice template, which shows us data from it, including a table with all the lines containing.

The definition of the table is done in the Word document itself with a syntax like:

@DOCUO.TABLE{Data source,[orden] ,[filtro] ,[reemplazo único] ,[top] }

Insert a Word table with labels inside here

@DOCUO.ENDTABLE{}

Where:

Data source: Supports a field label or category code . If we use a field label, we must specify the label of the dropdown field in the “child” category (invoice lines in the example) that connects it with the “parent” category (invoices in the example). If we specify the code of a category we can obtain any document from it.

If the field is of type file, and contains an image. the image will be embedded in the table cell, adjusting to the size of the table cell while preserving its aspect ratio.

Order : Optional parameter. Field labels by which you want to sort in ascending (ASC) or descending (DESC). Supports multiple fields separated by commas. If not specified, it is ordered by code

Filter : Optional parameter. Allows you to specify with T-SQL syntax the data filtering conditions.

Single replacement : Optional parameter. If TRUE, the data in the table is replaced only once. By default it is FALSE so that each time labels are replaced the data is automatically updated.

Top : Optional parameter. By default it is 100, it indicates the maximum number of records to show.

In the case of an Invoice, an example would be (within the Word template):

Invoice number:
Client:

@DOCUO.TABLE{, ' DESC'}

Concept Amount

@DOCUO.ENDTABLE{}

The table can be laid out as desired within Word 365.

The second row of the table will be repeated once for each “child” document (invoice lines) up to a limit of 100 lines.

If there is a third line (or successive ones), it can use labels from the parent category (for example, for the total of the invoice).

It is possible to obtain an example of each possible table in a category by generating a default Microsoft Word template in it.

Updated on 6 de November de 2023
Was this article helpful?

Related Articles