KoolReport's Forum

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

Phantom JS in docker #1620

Open icanstudioz app solutions opened this topic on on Sep 16, 2020 - 10 comments

icanstudioz app solutions commented on Sep 16, 2020

Hi,

We are unable to export report as Phantom JS is not working . getting Exception Could not find phantomjs executed file in bin folder.

already placed Phantom JS linux version in bin folder.

Please help.

David Winterburn commented on Sep 16, 2020

If you have problem with finding the correct path for phantomjs file please try to set its path directly like this:

$report->run()->export("MyReportPDF")
    ->settings([
        'phantomjs' => $pathToPhantomjs //e.g: "/home/user/bin/phantomjs"
    ])
    ->pdf(...)

If it's a linux version, please remember the path must be case sensitively correct as well. Let us know the result. Thanks!

icanstudioz app solutions commented on Sep 16, 2020

Hello,

Thanks we got executable working but we got unexpected result. see screenshot.

David Winterburn commented on Sep 17, 2020

Would you please post your export command's php code? Thanks!

icanstudioz app solutions commented on Sep 17, 2020

We are using laravel version 6.x

$report = new Supplierconnection();
        $report->run()->export('SupplierconnectionPdf')->settings(array(
            "useLocalTempFolder" => true
        ))->pdf(array(
            "format" => "A4",
            "orientation" => "landscap"
        ))->toBrowser("supplier_connection_" . date('Y-m-d') . ".pdf", true);
KoolReport commented on Sep 17, 2020

Please try

"orientation" => "landscape"

also, please make sure that there is no content echoing to stream before the exporting code. If there is something being sent, it will cause pdf header could not be sent ( which cause above issue).

icanstudioz app solutions commented on Sep 17, 2020

when i tried in my local machine than PDF got blank..

i already placed phantomjs in vendor/koolreport/export/bin

Export Function

        $report = new Customersalesdeal();
        $report->run()
                ->export('CustomersalesdealPdf')
                ->settings(array(
                    "useLocalTempFolder" => true,
                    "resourceWaiting" => 2000,
                ))
                ->pdf(array(
                    "format" => "A3",
                    "orientation" => "landscape",
                        //"zoom"=>2
                ))
                ->toBrowser("Customer_salesDeal" . date('Y-m-d') . ".pdf");

My PDF view page

<?php

use \koolreport\widgets\koolphp\Table;
?>

    <html>
<head>Report</head>
        <body style="margin:0.5in 1in 0.5in 1in">
           <div class="page-header" style="text-align:right"><i>Activation Recon Report</i></div>

            <hr/>
            <?php
            Table::create(array(
                "dataStore" => $this->dataStore("sales"),
                "cssClass" => array(
                    "table" => "table table-bordered"
                ),
            ));
            ?>
        </body>
    </html> 


KoolReport commented on Sep 17, 2020

Please check if phantomjs permission. Make sure it has permission to run, please try 755 to see how.

icanstudioz app solutions commented on Sep 17, 2020

for development i am using windows. and there is no permission issue.

David Winterburn commented on Sep 17, 2020

Please email your php files and the exported pdf to support@koolphp.net for us to check them for you. Thanks!

icanstudioz app solutions commented on Sep 17, 2020

I sent you a mail from ican***@gmail.com. please check and let me know.

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
None yet

Export