KoolReport's Forum

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

PDF Export download empty pdf in our production server (linux) #2902

Open Priya opened this topic on on Dec 14, 2022 - 10 comments

Priya commented on Dec 14, 2022

We have tested the output command in server which results - "0; Source file not found"

/var/www/html/dev-demo/vendor/koolreport/export/bin/phantomjs --ignore-ssl-errors=true /var/www/html/dev-demo/vendor/koolreport/export/pdf/pdf.js /tmp/6392f23cef29a2.tmp /tmp/6392f23cef3503.pdf eyJmb3JtYXQiOiJBNCIsIm9yaWVudGF0aW9uIjoibGFuZHNjYXBlIiwiZXhwZWN0ZWRMb2NhdGlvbiI6Imh0dHBzOlwvXC90YXMuaW5kaW5mcmF2aXQuY29tXC9kZXYtZGVtb1wvXC9kZXYtZGVtb1wvY3RkXC9leHBvcnRwZGYucGhwIiwicmVzb3VyY2VXYWl0aW5nIjoxMDAwfQ==

We are having tmp folder in public/html also in our source folder with 777 permission

Sebastian Morales commented on Dec 14, 2022

From your output command I see that it used the system tmp directory (/tmp). Pls test the following solutions:

1 . Use "useLocalTempFolder" in export setting and point it to your public/html's tmp dir like this:

    $report->export("SalesQuartersPdf")
        ->settings(array(
            'useLocalTempFolder' => 'path/to/public/html/tmp',
        ))
        ->pdf(array(...))

2 . Don't set "useLocalTempFolder" (export uses system tmp dir by default) and add read and write permissions of system tmp for your www user.

Let us know the result. Tks,

Priya commented on Dec 19, 2022

Thanks for your reply.

As per your suggestion I've set the local temp folder to public/html's tmp dir and gave read and write permission to www user. However it generate blank pdf only without any data inside.

Sebastian Morales commented on Dec 19, 2022

Oh, I did see the pivot table content in your pdf screenshot. Is there anything that I missed here?

Priya commented on Dec 19, 2022

Sorry for the inconvenience, I wrongly upload the screenshot of in my local windows environment.

Sebastian Morales commented on Dec 20, 2022

Pls try these tests:

1 . Use only a simple string in your report pdf view such as "Hello world" to export to pdf and see if it shows.

2 . If it does, try to set property "initVisible" => true for PivotTable widget in your report pdf view:

//MyReportPdf.view.php
PivotTable::create(array(
    ...
    "initVisible" => true,
));

Let us know the result. Tks,

Priya commented on Dec 22, 2022

I've tried with only "Hello World" too export to pdf, still it shows empty page only

Sebastian Morales commented on Dec 26, 2022

Ok, pls open the file 'koolreport/export/Handler.php' and find the following line:

        $result = shell_exec($command); 

and replace it with these ones:

        echo "command = $command<br>"; exit;
        $result = shell_exec($command);

Then export your report to see the echoed command. Copy the command and paste it into the server's command line/terminal to see how it runs.

Priya commented on Dec 30, 2022

Hello, Please help to remove the screenshot which I've shared previously in this post

Sebastian Morales commented on Dec 30, 2022

They have been removed per your request.

Priya commented on Dec 30, 2022

Thank you

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
bug
help needed

Export