I'm trying to make a conditional table header in reports which shows Discount column only when there is a discount. The condition works fine but I have an issue with formatting. Since blockTable colWidths parameter should correspond to the number of columns, I get an error when one of the columns gets deleted.
So far I came up with this markup as a test case:
<docAssign var='d' expr='0'/>
<section>
<para>[[repeatIn(o.order_line,'line')]]</para>
<para>[[ line.discount > 0 or removeParentNode('para') ]] <docExec stmt='d+=1'/></para>
</section>
<docIf cond='d>0'>
<para style="Standard">There are discounts</para>
<docElse/>
<para style="Standard">No discounts</para>
</docIf>
<docPara expr='d' format='The number of discounts is %(__expr__)d' />
However, I don't see any output from docIf condition and docPara. Moreover, examples of conditional format operators from RML User Guide doesn't produce any output either. Does someone have any idea of how to work around that?
Thanks!