KoolReport's Forum

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

Could not find phantomjs executed file in bin folder #1043

Closed Michael Ikhane opened this topic on on Aug 15, 2019 - 7 comments

Michael Ikhane commented on Aug 15, 2019

I am using Laravel 5.7, php 7.1 on a Mac

I have my phantomjs here in my laravel project:

port-transport-api/vendor/koolreport/packages/export/bin/phantomjs

File permission: -rwxr-xr-x 1 imyque admin 45020592 Aug 15 12:11 phantomjs

Controller:

$report->run()
        ->export()->pdf([
                            "format"=>"A4",
                            "orientation"=>"portrait"
                        ])->toBrowser("ComplaintsbyCompanyType.pdf");
Michael Ikhane commented on Aug 15, 2019

Hi,

I moved the bin folder to "port-transport-api/vendor/koolreport/export" and it generated the pdf, but the file is blank.

I will keep looking

KoolReport commented on Aug 15, 2019

If you try our example of export pdf in our example suite. Does it work?

Michael Ikhane commented on Aug 15, 2019

The export sample "SakilaRental" also came out blank even though it renders on HTML. My report also renders on HTML but comes out blank on PDF

KoolReport Pro 4.1.2

Export 4.0.0

CloudExport 1.6

Michael Ikhane commented on Aug 16, 2019

ComplaintsbyCompanyType.php

class ComplaintsbyCompanyType extends \koolreport\KoolReport
{
    use \koolreport\laravel\Friendship;
    use \koolreport\bootstrap4\Theme;
    use \koolreport\export\Exportable;

    function setup()
    { 
......

ComplaintsbyCompanyTypePDF.view.php

<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\BarChart;
?>
<html>
<body style="margin:0.5in 1in 0.5in 1in">
        <link rel="stylesheet" href="../../../assets/bs3/bootstrap.min.css" />
        <link rel="stylesheet" href="../../../assets/bs3/bootstrap-theme.min.css" />
        <div class="page-header" style="text-align:right"><i>Complaints Analysis By Company Type</i></div>
        <div class="page-footer" style="text-align:right">{pageNum}</div>
        <div class="container">

        <div class="row"><br/></div>
        <div class="row">
            <div class="col-md-12 text-center">
                <h3>Complaints Analysis By Company Type</h3>
                <h4><?php echo "{$this->params['quarter']}, {$this->params['year']}" ?></h4>
            </div>
        </div>
.....

ComplaintsbyCompanyType.view.php

<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\BarChart;
?>
<html>
    <head>
    <title>Complaints Report</title>
    </head>
    <body>
        <div class="container">

        <div class="row"><br/></div>
        <div class="row">
            <div class="col-md-12 text-center">
                <h3>Complaints Analysis By Company Type</h3>
                <h4><?php echo "{$this->params['quarter']}, {$this->params['year']}" ?></h4>
            </div>
        </div>
.....

ReportController.php:

public function kool() {
        $report = new ComplaintsbyCompanyType(['quarter' => 'Q3', 'year' => 2018]);
        $report->run()
        ->export('ComplaintsbyCompanyTypePDF')
        ->settings([
            "resourceWaiting"=>5000
        ])
        ->pdf([
                "format"=>"A4",
                "orientation"=>"portrait"
            ])
        ->toBrowser("ComplaintsbyCompanyType.pdf", true);
}
Michael Ikhane commented on Aug 16, 2019

I have found the problem. I was using the Laravel built-in server (php artisan serve). So I switched to my XAMPP (http://localhost/port-transport-api/public/api/auth/reports/kool) and the pdf is generated but the zoom too much, please help

$report->run()
        ->export('ComplaintsbyCompanyTypePDF')
        ->settings([
            "resourceWaiting"=>2000,
            "useLocalTempFolder"=>true,
        ])
        ->pdf([
                "format"=>"A4",
                "orientation"=>"portrait",
                "scale"=> "0.2"
            ])
        ->toBrowser("ComplaintsbyCompanyType.pdf", true);

Michael Ikhane commented on Aug 16, 2019

I have sorted out the zoom, but the chart is not showing:

$report->run()
        ->export('ComplaintsbyCompanyTypePDF')
        ->settings([
            "resourceWaiting"=>5000,
            "useLocalTempFolder"=>true,
        ])
        ->pdf([
                "format"=>"A4",
                "orientation"=>"portrait",
                "zoom"=> "0.55",
                "margin" => ["0.3in", "0.3in", "0.3in", "0.3in"]
            ])
        ->toBrowser("ComplaintsbyCompanyType.pdf", true);

Michael Ikhane commented on Aug 16, 2019

I increased the resourceWaiting to 10 secs. I guess my internet connection is slow for loading the remote scripts for the chart.

Case closed.

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