Different header on first page



  • Hello,
    I need to hide header on first page and then show header on all other pages.

    I'm using handlebars, and my idea was using #pageNum in header, but I was not able to have it working.

    I tried this way:
    {{#if pageNum == 1 }}
    <table width="100%" border="0" cellspacing="0" cellpadding="5" style="font-size: 12px;">
    <tr>
    <td width="6%" style="border-bottom:solid 1px #444; border-right:solid 1px #444;"><strong>Offerta n:</strong></td>
    <td width="26%" style="border-bottom:solid 1px #444; border-right:solid 1px #444;">{{offerta.codice}}</td>
    <td width="4%" style="border-bottom:solid 1px #444; border-right:solid 1px #444;"><strong>Data</strong></td>
    <td width="27%" style="border-bottom:solid 1px #444; border-right:solid 1px #444;">{{offerta.data}}</td>
    <td width="7%" style="border-bottom:solid 1px #444; border-right:solid 1px #444;"><strong>Cliente</strong></td>
    <td width="30%" style="border-bottom:solid 1px #444;">{{cliente.societa}}</td>
    </tr>
    </table>
    {{/if}}



  • There is example how to do this in the docs.

    https://jsreport.net/learn/phantom-pdf#page-numbers



  • Hi @jan_blaha , @Matteo-Agostoni , can you please show me a simple demo on https://playground.jsreport.net/ to hide header on first page and show in all other pages?


  • administrators

    hi @Noori

    easiest way is to make the header invisible for the first page (it is still there and occupies the same space just that it is not visible)

    https://playground.jsreport.net/w/anon/KXEOo1kk
    (check the getVisibility helper in the Header-Footer template)



  • Worked! .Thank you so much for the help @bjrmatos sir.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.