How to print table headers on all but the first page in freemarker
I'm having an issue with freemarker I'm hoping someone can help me with.
We use freemarker as part of a package for generating estimates for
customers. I recently added a footer portion so that it displays the page
number, that works great.
Now within our estimate we have the typical QTY, DESCRIPTION, PRICE - this
is run in an if/end statement printing out every item until we hit the end
of the "record size". Before this if/then runs, we are printing the table
header via HTML.
Well the problem we have is if the estimate goes onto a 2nd/3rd/etc...
page, the header for that table does not appear.
I figured I could write something so that it prints in the BODY HEADER on
every page, which would be fine. HOWEVER we do not want it to print on
PAGE 1, because Page 1 has the company ship to/etc... and its not needed.
I tried adding the following but because this macrolist is in between my
HEAD and /HEAD tags, it basically runs once and does not change my value,
it reports back as 0 every time.
Any idea on what I can do to solve my issue?
<macro id="item-header">
<#assign count = 0>
<#assign count = count + 1>
<#if count = 0>
<table class="border" width="100%" cellpadding="2">
<tr>
<td width="5%" class="border4" valign="center"><b>Qty</b></td>
<td width="71%" class="border4"
valign="center"><b>Description</b></td>
<td width="12%" class="border4" valign="center"
align="right"><b>Unit Price</b></td>
<td width="12%" class="border5" valign="center"
align="right"><b>Ext. Price</b></td>
</tr>
</table>
<#else>
<p>Count: ${count}</p>
</#if>
</macro>
</macrolist>
Again with all this, my COUNT value always stays 0, it does not increase...
any thoughts please? Thanks.
No comments:
Post a Comment