KoolReport's Forum

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

Export to pdf #1428

Closed branden opened this topic on on May 7, 2020 - 6 comments

branden commented on May 7, 2020

Hi Koolreport,

I've encountered the same issues in topic #1417

It seems he resolved it by 'creating absolute paths through assets'

How do i do this ?

I'm using laravel 6. The charts do not get exported while the datatables does. I haven't defined the path to the assets folder before since laravel already creates the 'koolreport_assets' folder under the public directory.

Please assist with this matter.

function settings()
    {
        return array(
            

             "assets" =>[
                "path" => "/home/oem/PhpstormProjects/Smartz_Analytics/public/koolreport_assets",
                "url"=>"/koolreport_assets"
            ]
        );
    }

Even after specifying the above, i see no difference

Thanks

branden commented on May 7, 2020

So i've manage to change the assets folder path using this topic https://www.koolreport.com/forum/topics/198 , However my ColumnCharts do not export on the pdf

branden commented on May 7, 2020

What could be the reasons for it not exporting ?

branden commented on May 7, 2020

while debugging i found this on the runPhantom function. Could this cause any issues?

ReferenceError: Can't find variable: KoolReport

undefined:1025 in global code :0 in setContent phantomjs://code/pdf.js:276 in run 1

KoolReport commented on May 8, 2020

Hi branden,

This is a known issue when phantomjs working with built-in php web server (php -S). We are still testing below solution. Please locate the file "koolreport/export/Handler.php", look for this line in pdf() method

$params["expectedLocation"] = $this->getFullUrl();

and you change to

$params["expectedLocation"] = str_replace("http://","",$this->getFullUrl());

This solution will be implemented in next version of export package when we are done with testing.

Please reverse to us if above solution is working.

Andre Van Der Walt commented on May 8, 2020

Thanks for the response.

The report exports with no charts or styling on the table.

KoolReport commented on May 8, 2020

After further testing, our conclusion is that export package does not work with PHP Built-in Webserver (PBW). PhantomJS could not be able to load any resources like css, js, image returned by PBW. The PBW is minimal web server and the return header is not the same like Apache or Ngnix that causes trouble to phantomjs. Or phantomjs does not expect return data of PWB. So here are some points:

  1. Export package work great with production/testing server with Apache or Nginx
  2. Export package will not work with PHP Built-In Webserver
  3. Export package does not have issue with url with port

Our suggestion: Develop and Test Pdf export feature with Apache/Ngnix environment. For other, you may use PBW as normal.

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