Search code examples
printingheaderrepeatjsrenderjsreport

jsrender/jsreport - How to print a variable an all the pages


I'm using jsreport and using jsrender engine to generate PDF reports.

I want to print some variables on all the pages (but not in the page header or footer), and also a header of a table should appear on all pages. How Can I specify to print something on all pages ?

Thank you.


Solution

  • This could be potentially do-able with thead tag, which by default prints on each page of the long table

    <table>
      <thead>
        <tr><td>Repeated thing here</td></tr>
      </thead>
      <tbody>
         <tr>....</tr>
      </tbody>
    </table>
    

    Unfortunately this is very buggy in all printing engines, so you may have problems with it, some workarounds are mentioned here https://github.com/ariya/phantomjs/issues/10927