KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

PDF Page header NOT repeated on each page #831

Open gkurl opened this topic on on Apr 25, 2019 - 2 comments

gkurl commented on Apr 25, 2019

Hi guys,

I have applied header to PDF export like in example, however it only appears on the first page, and then never again on any other page?

My header:

 <header style='height:30px'>
            <span>Employee Performance </span>
        </header>

Something I missed?

Thanks.

David Winterburn commented on Apr 26, 2019

Hi,

To create header for every page, please use this setting:

$report->export("SalesQuartersPdf")
    ->pdf(array(
        "format"=>"A4",
        "header"=>array(
            "height"=>"1cm",
            "contents"=>"This is a header{pageNum}/{numPages}"
        ),
    ))
    ->toBrowser("SalesQuarters.pdf")
    ;

Thanks!

gkurl commented on May 1, 2019

Hi Thanks for the reply.

Sending in settings was restriction on my end as I have multiple reports being processed by one class.

So I solved in template by doing this:

 <header style='height:30px'>
            <div class="page-header"> <?php Table::create(['dataSource' => resultset1, 'columns' => [
				'Header1' => ['label' => '']]]);                                

I adapted this from previous answer one of your colleagues gave me on same issue I had with page numbers not displaying where I had to use:

<div class="page-footer" style="text-align:center; font-size:0.8em;">{pageNum}/{numPages}</div>

Thanks for your help!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

Export