KoolReport's Forum

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

Koolreport undefined at staging environment #3194

Open Hasvier Reporting opened this topic on on Nov 22, 2023 - 1 comments

Hasvier Reporting commented on Nov 22, 2023

Hi, i have a problem which encounter error at staging environment kf-jabatan:2645 Uncaught ReferenceError: KoolReport is not defined

At local environment it works well. But when we copy folder app to staging, getting error Uncaught ReferenceError: KoolReport is not defined

GET https://ddmsstaging.dbkl.gov.my/era/public/era/vendor/koolreport/core/src/clients/core/KoolReport.js net::ERR_ABORTED 404 (Not Found)

KoolReport.widget.init({"js":["\/era\/vendor\/koolreport\/core\/src\/clients\/jquery\/jquery.min.js",    ["\/era\/vendor\/koolreport\/core\/src\/widgets\/koolphp\/table\/table.js"]],"css":    ["\/era\/vendor\/koolreport\/core\/src\/widgets\/koolphp\/table\/table.css"]},function(){
tableData = new KoolReport.koolphp.table('tableData',{"cKeys":["adt_id","fungsi","aktiviti","sub_aktiviti","bil_fail"],"removeDuplicate":[],"paging":{"pageSize":10,"pageIndex":0,"align":"center","itemCount":132,"pageCount":14}});
    });

below is my code using Table:

        Table::create(array(
                    "name"       => "tableData",
                    "dataSource" => $tableData,
                    "columns" => array(
                        "adt_id" => array(
                            "label" => "No"
                        ),
                        "fungsi" => array(
                            "label" => "Fungsi",
                            
                        ),
                        "aktiviti" => array(
                            "label" => "Aktiviti",
                            
                        ),
                        "sub_aktiviti" => array(
                            "label" => "Sub Aktiviti",
                            
                        ),
                        "bil_fail" => array(
                            "label" => "Bilangan Fail",
                            "formatValue" => function ($value, $rowData) use ($listsArray) {
                                $ddms_file_classification_id = $listsArray[$rowData['adt_id'] - 1]['ddms_file_classification_id'];
                                $ddms_file_classification_id1 = $listsArray[$rowData['adt_id'] - 1]['ddms_file_classification_id1'];
                                $ddms_file_classification_id2 = $listsArray[$rowData['adt_id'] - 1]['ddms_file_classification_id2'];
                                $organization_id = $listsArray[$rowData['adt_id'] - 1]['organization_id'];
                                $url = '/report/details-kf-fail/'.$organization_id.'/' . $ddms_file_classification_id . '/' . $ddms_file_classification_id1 . '/' . $ddms_file_classification_id2;
                                return '<a href="' . $url . '">' . $value . '</a>';
                            },
                        )
                    ),
                        "cssClass"=>array(
                        "table"=>"table-bordered table-striped table-hover"
                    ),
                    "paging"=>array(
                        "pageSize"=>10,
                        "pageIndex"=>0,
                        "align"=>"center"
                    ),
                ));

I alredy remove package and try to install back still same. Please help.

KoolReport commented on Nov 22, 2023

I think in your production server, the "vendor" folder is protected and it should be like that for security. What you need to do is to guide koolreport to export its resource to public place where js/css file can be accessed.

Here is the documentation on the assets settings.

Hope that helps.

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

Laravel