KoolReport's Forum

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

What's the difference between manual export and one with cron (automatic action)? #3404

Open TICGAL opened this topic on 3 days ago - 2 comments

TICGAL commented 3 days ago

Good morning, I have a problem with exporting PDFs, when I set up a cron (automatic export) on my server it is created in a different path than if I do it manually. Does anyone know why it could be? Server variables?

If I do it manually:

src='/plugins/reporting/public/vendor/koolreport/core/src/clients/core/KoolReport.js'

If cron does it automatically:

src='/var/www/html/glpi/front/koolreport_assets/4199708146/KoolReport.js'

Sebastian Morales commented 2 days ago

Yes, if you run PHP script directly there will be no $_SERVER variable for KoolReport to be able to export reports to PDF, which requires a web server path. How about using Cron to send a post request (such as curl, etc) to your export page and output the result to a PDF file?

TICGAL commented 1 day ago

I can't do it with a curl post request.

How can I customize assets location?

I checked the docs and it said that I can send an url and a path, but it's not working for me.

It needs to be public?

Is the assets folder a tmp folder?

Is it possible to modify $_SERVER when the cron task auto generate a pdf?

My $_SESSION when a cron task runs:

Array
(
    [HOME] => /var/www
    [LOGNAME] => www-data
    [PATH] => /usr/bin:/bin
    [SHELL] => /bin/sh
    [PWD] => /var/www
    [PHP_SELF] => /var/www/html/glpi/front/cron.php
    [SCRIPT_NAME] => /var/www/html/glpi/front/cron.php
    [SCRIPT_FILENAME] => /var/www/html/glpi/front/cron.php
    [PATH_TRANSLATED] => /var/www/html/glpi/front/cron.php
    [DOCUMENT_ROOT] => 
    [REQUEST_TIME_FLOAT] => 1735905721.5259
    [REQUEST_TIME] => 1735905721
    [argv] => Array
        (
            [0] => /var/www/html/glpi/front/cron.php
        )

    [argc] => 1
)

No Koolreport or my plugin path, name or filename information

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