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 on Jan 2 - 4 comments

TICGAL commented on Jan 2

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 on Jan 3

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 on Jan 3

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

TICGAL commented on Jan 10

Anyone knows if this is possible?

We think that this is what we need to solve this issue

Thanks

Sebastian Morales commented on Jan 13

In any case you still need a web server that serves your report because Export package uses a headless browser engine to access a report page (which is served by the web server) to render it to PDF. If you do have the web server for your automatic reports, we will think of a solution for your case.

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