I am trying to use a simple freemarker macro in an XDocReport, but I couldn't find a way to add and call it.
<#macro address company>
<#if company.name??>${company.name}</#if>
<#if company.address??>${company.address}</#if>
</#macro>
I am trying to use a simple freemarker macro in an XDocReport, but I couldn't find a way to add and call it.
<#macro address company>
<#if company.name??>${company.name}</#if>
<#if company.address??>${company.address}</#if>
</#macro>
You need to add MergeField (which has limit, you can divided in 2 fields) with text:
[#macro address company]
[#if company.name??]${company.name}[/#if]
[#if company.address??]${company.address}[/#if]
[/#macro]
And separated MergeField to call it (quotes,square brackets are important):
"[@address company=c1]"
Should be:
where
c
is your company object