KoolReport's Forum

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

Callback function in header (phantomjs) #1681

Open Thomas opened this topic on on Oct 23, 2020 - 3 comments

Thomas commented on Oct 23, 2020

I would like to display the different section names in the header. There is a callback function but how do I implement it in koolreport?

This is my code in the export.php:

"header"=>array(
            "height"=>"30px",
            "contents"=> array(
                'callback'=>'function (pageNum, numPages) {
                    return "<p>Page " + pageNum + " of " + numPages + "</p>"; //WORKS fine
                }'
            ),
        ),
Thomas commented on Oct 23, 2020

I've also tried the following, which only returns the string.

"contents" => 'phantom.callback(function (pageNum, numPages) {
                    return "<p>Page " + pageNum + " of " + numPages + "</p>"; 
                })'
Thomas commented on Oct 26, 2020

I found this post:

https://stackoverflow.com/questions/17102287/footers-contents-dont-seem-to-work

But how does it fit in to KoolReport? That would great possibility to customize the report.

Sebastian Morales commented on Oct 27, 2020

Thomas, the next version of Export would allow users to fully customize header/footer for each page using a js callback function. Please drop us an email to support@koolphp.net. We would send you a development version of Export for you to test it. Cheers, Sebastian

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

Export