{"id":4196,"date":"2021-11-19T19:04:01","date_gmt":"2021-11-19T18:04:01","guid":{"rendered":"https:\/\/help.r2docuo.com\/knowledge-base\/table-macros-in-word-365-templates\/"},"modified":"2023-11-06T09:20:51","modified_gmt":"2023-11-06T08:20:51","slug":"table-macros-in-word-365-templates","status":"publish","type":"ht_kb","link":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/","title":{"rendered":"Table macros in Word 365 templates"},"content":{"rendered":"\n<p>This macro for Docuo templates in Word allows you to display the data of one or more &#8220;child&#8221; documents of another category in a table.<\/p>\n\n<p>Table macros in Word templates are only <strong>available in Docuo Enterprise.<\/strong><\/p>\n\n<p>For example, if we have two categories: &#8220;Invoices&#8221; and &#8220;Invoice lines&#8221; 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.<\/p>\n\n<p>The definition of the table is done in the Word document itself with a syntax like:<\/p>\n\n<div style=\"padding: 1em; border: 1px dashed #2f6fab; color: black; background-color: #f9f9f9; line-height: 1.1em; font-size: 0.8em;\">\n<p><tt>@DOCUO.TABLE{Data source,[orden] ,[filtro] ,[reemplazo \u00fanico] ,[top] }<\/tt><\/p>\n<p><em>Insert a Word table with labels inside here<\/em><\/p>\n<p><tt>@DOCUO.ENDTABLE{}<\/tt><\/p>\n<\/div>\n\n<p>Where:<\/p>\n\n<p><strong>Data source:<\/strong> Supports a field label or category code <strong>.<\/strong> If we use a field label, we must specify the label of the dropdown field in the &#8220;child&#8221; category (invoice lines in the example) that connects it with the &#8220;parent&#8221; category (invoices in the example). If we specify the code of a category we can obtain any document from it.<\/p>\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon\">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.<\/p>\n\n<p><strong>Order<\/strong> : 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<\/p>\n\n<p><strong>Filter<\/strong> : Optional parameter. Allows you to specify with T-SQL syntax the data filtering conditions.<\/p>\n\n<p><b>Single replacement<\/b> : 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.<\/p>\n\n<p><b>Top<\/b> : Optional parameter. By default it is 100, it indicates the maximum number of records to show.<\/p>\n\n<p>In the case of an Invoice, an example would be (within the Word template):<\/p>\n\n<div style=\"padding: 1em; border: 1px dashed #2f6fab; color: black; background-color: #f9f9f9; line-height: 1.1em; font-size: 0.8em;\">\n<p>Invoice number:  <br\/>Client:  <\/p>\n<p><tt>@DOCUO.TABLE{, ' DESC'}<\/tt><\/p>\n<table style=\"width: 100%;\" border=\"1\">\n<tbody>\n<tr>\n<td width=\"142\"><strong>Concept<\/strong><\/td>\n<td width=\"142\"><strong>Amount<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"142\"><\/td>\n<td width=\"142\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><tt>@DOCUO.ENDTABLE{}<\/tt><\/p>\n<\/div>\n\n<p>The table can be laid out as desired within Word 365.<\/p>\n\n<p><strong>The second row of the table will be repeated once for each &#8220;child&#8221; document (invoice lines) up to a limit of 100 lines. <\/strong><\/p>\n\n<p>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).<\/p>\n\n<p>It is possible to obtain an example of each possible table in a category by generating a default Microsoft Word template in it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This macro for Docuo templates in Word allows you to display the data of one or more &#8220;child&#8221; 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: &#8220;Invoices&#8221; and &#8220;Invoice lines&#8221; related to each&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"content-type":"","footnotes":""},"ht-kb-category":[58],"ht-kb-tag":[83],"class_list":["post-4196","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-macros","ht_kb_tag-docuo-enterprise"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Table macros in Word 365 templates - R2 Docuo | Help center<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Table macros in Word 365 templates - R2 Docuo | Help center\" \/>\n<meta property=\"og:description\" content=\"This macro for Docuo templates in Word allows you to display the data of one or more &#8220;child&#8221; 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: &#8220;Invoices&#8221; and &#8220;Invoice lines&#8221; related to each...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/\" \/>\n<meta property=\"og:site_name\" content=\"R2 Docuo | Help center\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-06T08:20:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/help.r2docuo.com\/wp-content\/uploads\/2021\/03\/Post-type-Guias-de-usuario.png\" \/>\n\t<meta property=\"og:image:width\" content=\"845\" \/>\n\t<meta property=\"og:image:height\" content=\"564\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@R2Docuo\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/en\\\/knowledge-base\\\/table-macros-in-word-365-templates\\\/\",\"url\":\"https:\\\/\\\/help.r2docuo.com\\\/en\\\/knowledge-base\\\/table-macros-in-word-365-templates\\\/\",\"name\":\"Table macros in Word 365 templates - R2 Docuo | Help center\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/en\\\/knowledge-base\\\/table-macros-in-word-365-templates\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/en\\\/knowledge-base\\\/table-macros-in-word-365-templates\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/help.r2docuo.com\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Post-type-Guias-de-usuario.png\",\"datePublished\":\"2021-11-19T18:04:01+00:00\",\"dateModified\":\"2023-11-06T08:20:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/en\\\/knowledge-base\\\/table-macros-in-word-365-templates\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/help.r2docuo.com\\\/en\\\/knowledge-base\\\/table-macros-in-word-365-templates\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/en\\\/knowledge-base\\\/table-macros-in-word-365-templates\\\/#primaryimage\",\"url\":\"https:\\\/\\\/help.r2docuo.com\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Post-type-Guias-de-usuario.png\",\"contentUrl\":\"https:\\\/\\\/help.r2docuo.com\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Post-type-Guias-de-usuario.png\",\"width\":845,\"height\":564},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/en\\\/knowledge-base\\\/table-macros-in-word-365-templates\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/help.r2docuo.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Table macros in Word 365 templates\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/#website\",\"url\":\"https:\\\/\\\/help.r2docuo.com\\\/\",\"name\":\"R2 Docuo | Help center\",\"description\":\"Todos los recursos para usuarios, administradores y desarrolladores de de R2 Docuo a tu alcance\",\"publisher\":{\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/help.r2docuo.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/#organization\",\"name\":\"R2 Docuo | Help center\",\"url\":\"https:\\\/\\\/help.r2docuo.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/help.r2docuo.com\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/ILUDEST_CENTRODEAYUDA.png\",\"contentUrl\":\"https:\\\/\\\/help.r2docuo.com\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/ILUDEST_CENTRODEAYUDA.png\",\"width\":1200,\"height\":630,\"caption\":\"R2 Docuo | Help center\"},\"image\":{\"@id\":\"https:\\\/\\\/help.r2docuo.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/R2Docuo\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/r2docuo\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Table macros in Word 365 templates - R2 Docuo | Help center","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Table macros in Word 365 templates - R2 Docuo | Help center","og_description":"This macro for Docuo templates in Word allows you to display the data of one or more &#8220;child&#8221; 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: &#8220;Invoices&#8221; and &#8220;Invoice lines&#8221; related to each...","og_url":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/","og_site_name":"R2 Docuo | Help center","article_modified_time":"2023-11-06T08:20:51+00:00","og_image":[{"width":845,"height":564,"url":"https:\/\/help.r2docuo.com\/wp-content\/uploads\/2021\/03\/Post-type-Guias-de-usuario.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@R2Docuo","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/","url":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/","name":"Table macros in Word 365 templates - R2 Docuo | Help center","isPartOf":{"@id":"https:\/\/help.r2docuo.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/#primaryimage"},"image":{"@id":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/#primaryimage"},"thumbnailUrl":"https:\/\/help.r2docuo.com\/wp-content\/uploads\/2021\/03\/Post-type-Guias-de-usuario.png","datePublished":"2021-11-19T18:04:01+00:00","dateModified":"2023-11-06T08:20:51+00:00","breadcrumb":{"@id":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/#primaryimage","url":"https:\/\/help.r2docuo.com\/wp-content\/uploads\/2021\/03\/Post-type-Guias-de-usuario.png","contentUrl":"https:\/\/help.r2docuo.com\/wp-content\/uploads\/2021\/03\/Post-type-Guias-de-usuario.png","width":845,"height":564},{"@type":"BreadcrumbList","@id":"https:\/\/help.r2docuo.com\/en\/knowledge-base\/table-macros-in-word-365-templates\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/help.r2docuo.com\/"},{"@type":"ListItem","position":2,"name":"Table macros in Word 365 templates"}]},{"@type":"WebSite","@id":"https:\/\/help.r2docuo.com\/#website","url":"https:\/\/help.r2docuo.com\/","name":"R2 Docuo | Help center","description":"Todos los recursos para usuarios, administradores y desarrolladores de de R2 Docuo a tu alcance","publisher":{"@id":"https:\/\/help.r2docuo.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/help.r2docuo.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/help.r2docuo.com\/#organization","name":"R2 Docuo | Help center","url":"https:\/\/help.r2docuo.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/help.r2docuo.com\/#\/schema\/logo\/image\/","url":"https:\/\/help.r2docuo.com\/wp-content\/uploads\/2023\/06\/ILUDEST_CENTRODEAYUDA.png","contentUrl":"https:\/\/help.r2docuo.com\/wp-content\/uploads\/2023\/06\/ILUDEST_CENTRODEAYUDA.png","width":1200,"height":630,"caption":"R2 Docuo | Help center"},"image":{"@id":"https:\/\/help.r2docuo.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/R2Docuo","https:\/\/www.linkedin.com\/company\/r2docuo"]}]}},"_links":{"self":[{"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/ht-kb\/4196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/comments?post=4196"}],"version-history":[{"count":0,"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/ht-kb\/4196\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/media\/4053"}],"wp:attachment":[{"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/media?parent=4196"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/ht-kb-category?post=4196"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/help.r2docuo.com\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=4196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}