KoolReport's Forum

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

Integration of Koolreport with Cakephp 3.7 #1363

Open Praveen opened this topic on on Mar 30, 2020 - 14 comments

Praveen commented on Mar 30, 2020

Hello,

I wanted to integrate Koolreport with Caklephp 3.7 , and followed the steps as mentioned in the below URL : https://www.koolreport.com/docs/integration/cakephp/

But getting the error as

2020-03-30 12:02:18 Error: [Cake\Error\FatalErrorException] Class 'koolreport\KoolReport' not found in /shared/httpd/nsms/SMS/src/Reports/MyReport.php on line 5 Stack Trace: #0 /shared/httpd/nsms/SMS/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(109): Cake\Error\BaseErrorHandler->handleFatalError(1, 'Class 'koolrepo...', '/shared/httpd/n...', 5) #1 [internal function]: Cake\Error\BaseErrorHandler->Cake\Error{closure}() #2 {main}

Please let me know the solution to above error.

KoolReport commented on Mar 30, 2020

We have made an working tutorial KoolReport in CakePHP, you may clone to see how it works.

From the error you described, probably the Koolreport has not installed with composer.

Praveen commented on Mar 30, 2020

thanks for the reply.

We have made an working tutorial KoolReport in CakePHP, you may clone to see how it works.---> I followed the same code

From the error you described, probably the Koolreport has not installed with composer. - I have installed with composer but still getting the below error thanks for the reply.

We have made an working tutorial KoolReport in CakePHP, you may clone to see how it works.---> I followed the same code

From the error you described, probably the Koolreport has not installed with composer. - I have installed with composer but still getting the below error

2020-03-30 12:02:18 Error: [Cake\Error\FatalErrorException] Class 'koolreport\KoolReport' not found in /shared/httpd/nsms/SMS/src/Reports/MyReport.php on line 5 Stack Trace: #0 /shared/httpd/nsms/SMS/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(109): Cake\Error\BaseErrorHandler->handleFatalError(1, 'Class 'koolrepo...', '/shared/httpd/n...', 5) #1 [internal function]: Cake\Error\BaseErrorHandler->Cake\Error{closure}() #2 {main}

KoolReport commented on Mar 30, 2020

Could you please checked if the "vendor/koolreport/core" folder is existing.

Praveen commented on Mar 30, 2020

This folder has the content : "vendor/koolreport/core"

its not missing. Its downloaded with composer.

KoolReport commented on Mar 31, 2020

Do you create report with action of cakephp's controller? Otherwise, in the MyReport.php you put:

require_once "/path/to/vendor/koolreport/core/autoload.php";

on the top of the file.

Praveen commented on Mar 31, 2020

I followed the same steps mentioned in the below URL : https://www.koolreport.com/docs/integration/cakephp/

I created the report with action of cakephp's controller

KoolReport commented on Mar 31, 2020

We are using CakePHP 4 so I am not sure if there is different between 3 and 4 that "vendor/autoload.php" of composer is not loaded. If it is loaded like in Cakephp, KoolReport will be available as well. So please try my suggestion above, adding the koolreport autoload to MyReport.php

Praveen commented on Mar 31, 2020

sure. can you share the exact path . As its in vendor directory, please replace /path/to with the correct location and send me. I am following the cakephp directory structure.

require_once "/path/to/vendor/koolreport/core/autoload.php";

Praveen commented on Mar 31, 2020

Here is the content of MyReport.php

namespace App\Reports;

require_once "/vendor/koolreport/core/autoload.php";


class MyReport extends \koolreport\KoolReport
{
    function settings()
    {
        return array(
            "assets"=>array(
                "path"=>"../../webroot/koolreport_assets",
                "url"=>"webroot/koolreport_assets"
            )
        );
    }    
}

But getting below error in the browser

This page isn’t workingnsms.odinlearning.in is currently unable to handle this request. HTTP ERROR 500

KoolReport commented on Mar 31, 2020

I am not sure what your folder structure there in your application, so you must find the correct path to vendor, you may use relative path there. I suggest:

require_once "../../vendor/koolreport/core/autoload.php";
Praveen commented on Mar 31, 2020

I used the below relative path : require_once "../../vendor/koolreport/core/autoload.php";

But still same HTTP ERROR 500

KoolReport commented on Mar 31, 2020

Please use error_reporting() to turn on, error 500 is general and you will not know what go wrong.

Praveen commented on Mar 31, 2020

Error: [Cake\Error\FatalErrorException] Class 'koolreport\KoolReport' not found in /shared/httpd/nsms/SMS/src/Reports/MyReport.php on line 5 Stack Trace: #0 /shared/httpd/nsms/SMS/vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(109): Cake\Error\BaseErrorHandler->handleFatalError(1, 'Class 'koolrepo...', '/shared/httpd/n...', 5) #1 [internal function]: Cake\Error\BaseErrorHandler->Cake\Error{closure}() #2 {main}

KoolReport commented on Mar 31, 2020

Please check the in require_once, it may not be correct yet. Also, please move the require_once to top of the file, before the namespace.

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