Remove field from the PDF template if the field has no value.

If no value is entered into the “Shipping Cost” field, it should not appear whatsoever and only the “Subtotal” and “Total” should appear (see figure below).

<tr>
          <#if record.shippingcost?trim != ''>
            <td align="right"><b>${record.shippingcost@label}</b></td>
            <td align="right" style="width: 105px;">${record.shippingcost}</td><#else><td align="right" style="width: 105px;">&nbsp;</td></#if>
</tr>

Leave a comment

Your email address will not be published. Required fields are marked *