1. Home
  2. Administrators
  3. Document templates
  4. Macros
  5. Table macro to omit rows in Word 365 templates

Table macro to omit rows in Word 365 templates

The @DOCUO.DeleteRowIfZero macro, used in a table cell in Word 365, allows you to indicate whether to delete the entire row when the label(s) it contains result in an empty text string or a zero.

This functionality must be used in conjunction with the Word table macro @DOCUO.Table, when the table displays data from the document category itself, because in the case of child documents the filter parameter must be used to omit unneeded rows.

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

The table definition, for data from the document itself, is marked in Word with a syntax like:

@DOCUO.TABLE{}
Insert here a Word table with labels inside it.
@DOCUO.ENDTABLE{}

In the case of tables with data from the document itself, the @DOCUO.TABLE macro has no parameters.

For more information on how to use table macros to display information from related documents visit the link:

https://help.r2docuo.com/knowledge-base/guia-macros-de-tabla-en-plantillas-de-word/

For example, in the case of an Offer category (within the Word template) where we have a table that breaks down a group of amount fields where we do not want to display lines with zero amount, we would use the macro as:

@DOCUO.TABLE{}

ConceptAmount
Consulting@DOCUO.DeleteRowIfZero(<@Imports:Consulting>)
Development@DOCUO.DeleteRowIfZero(<@Imports:Development>)
Training@DOCUO.DeleteRowIfZero(<@Imports:Training>)
Licenses@DOCUO.DeleteRowIfZero(<@Imports:Licenses>)
Total<Amounts:Total>

@DOCUO.ENDTABLE{}

In this way, if in the document data only Consulting and Development are filled in, our result table in the Word document would have the final aspect:

ConceptAmount
Consulting1.200 €
Development3.000 €
Total4.200 €
Updated on 29 de March de 2023
Was this article helpful?

Related Articles