KoolReport's Forum

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

Open pdf (toBrowser) in new aba/window #468

Open Gustavo Fraga opened this topic on on Sep 17, 2018 - 2 comments

Gustavo Fraga commented on Sep 17, 2018

This is possible?

KoolReport commented on Sep 18, 2018

Yes, it is possible.

On the view you add:

<a target="_blank" href="export.php">Download PDF</a>

And in the export.php, you do:

...
$report->export()->pdf()->toBrowser("myfile.php",true);

The second true parameter in the toBrowser() function indicate that PDF will open on browser instead of download forcing. And together with target='_blank' on the <a> the browser will open pdf file in a new separated window.

Gustavo Fraga commented on Sep 18, 2018

Thanks for the attention, I feel stupid for not having thought of this before... As I need to send a form to the controller, I wrote this:

<form target="_blank" [...]

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
suggestion

Export