KoolReport's Forum

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

KoolReport is not defined #2605

Open FIMM opened this topic on on Mar 7, 2022 - 7 comments

FIMM commented on Mar 7, 2022

Hello I am using laravel+koolreport. I have nginx proxy server running with a docker. The laravel project is running in another docker container. While trying connect to the report from nginx to larvel api routes it is conneced. However, the KoolReport.js and other css are missing from there.

MyReport.php is

protected function settings()
    {
        return array(
            "assets"    => [
                "path"=>"../../public/koolreport_assets",
                "url"=>"/koolreport_assets"
            ]
        );
    }

Please help me. it's very urgent. Thanks

Sebastian Morales commented on Mar 7, 2022

Did you use our Laravel package with its friendship trait:

https://www.koolreport.com/docs/laravel/overview/#step-by-step-tutorial-step-1:-create-report-and-claim-friendship-with-laravel

If not pls consider using it and see the result. In any case pls your browser dev tool (F12), go to tab Network to see the url path of KoolReport.js and see if it's correct or not. Tks,

FIMM commented on Mar 7, 2022

Yes I am using Laravel package with its friendship trait Here is the js file link but this link not loading css and js

FIMM commented on Mar 7, 2022

MyReport.php look like below:

<?php
namespace App\Reports;
class CasUtcReport extends \koolreport\KoolReport
{
    use \koolreport\laravel\Friendship;
    use \koolreport\clients\FontAwesome;
    use \koolreport\amazing\Theme;
    use \koolreport\export\Exportable;
    protected function settings()
    {
        return array(
            "assets"=>array(
                "path"=>"../../public/koolreport_assets",
                "url"=>"/koolreport_assets"
            )
        );
    }

Nothing Loading inside <head> </head> tag

KoolReport commented on Mar 7, 2022

I see in your image that you have the KoolReport.js url. Please click into the link and see if you can load the file. Also please check in the folder "koolreport_assets/31..10/" to see if you have the KoolReport.js file.

FIMM commented on Mar 7, 2022

Yes all file exists there. But koolReport.js not loading.

KoolReport commented on Mar 7, 2022

It seems to me KoolReport did a good job to export the KoolReport.js and providing the url to the file. Would you mind to check if Laravel or settings that prevent url of a resource to be loaded from browser.

Sebastian Morales commented on Mar 8, 2022

If you use Laravel Friendship trait, pls try removing the "asset" property in settings():

            // "assets"=>array(
                // "path"=>"../../public/koolreport_assets",
                // "url"=>"/koolreport_assets"
            // )

Anyway, pls open browser dev tool (F12), go to tab Network and look for KoolReport.js and let us know its url path. Rgds,

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

None