Conditional Formatting in DOCX Recipe
-
Does anyone know how to change the font color depending on the value of data in a docx recipe?
-
You can use
docxStyle
system helper to set the color conditionally.
https://jsreport.net/learn/docx#docxstyle
-
Thanks - Can you nest that inside a table?
I've tried
{{#docxTable governingBodyPolicies}} {{#docxStyle textColor=colour}}
{{policy.name}} {{committeeName}} {{adoptionDateString}} {{renewalDateString}} {{note}}
{{/docxStyle}} {{/docxTable}}but the generated document is corrupted.
-
It was something weird in the formatting of my template, copied it to plain text and pasted it back and it's working now.
Thanks