KoolReport's Forum

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

CodeIgniter Integration #1201

Open Ed Martin opened this topic on on Dec 3, 2019 - 8 comments

Ed Martin commented on Dec 3, 2019

I am getting very confused by the various options to integrate KoolReport Pro with CodeIgniter. I have not been able to get the sample reports to display as I am having trouble finding the autoload.php which is being required in the MyReport.php controller file. My error indicates the file cannot be found, but there is an error in the path, application is appearing in the path, but I am not sure as to why. My base url is "http://localhost/123/".

I have used composer to install KoolReport Pro, so the files are under the vendor folder.

A PHP Error was encountered Severity: Warning Message: require(C:\xampp\htdocs\123\application\vendor/autoload.php): failed to open stream: No such file or directory Filename: reports/MyReport.php Line Number: 3

KoolReport commented on Dec 4, 2019

Could you please check if the path "C:\xampp\htdocs\123\application\vendor/autoload.php" is correct? Can you find that autoload.php file.

Ed Martin commented on Dec 4, 2019

The actual path is "C:\xampp\htdocs\123\vendor/autoload.php" The system is adding in the reference to the application directory. I used Composer to install Koolreport Pro. The vendor folder is the same level as application.

I have the base url set as http://localhost/123

KoolReport commented on Dec 4, 2019

What is the your require command for the vendor/autoload.php? Can you paste it here.

Ed Martin commented on Dec 4, 2019

<?php //MyReport.php require APPPATH."vendor/autoload.php";

KoolReport commented on Dec 4, 2019

So you change to:

require_once APPPATH."../vendor/autoload.php";
Ed Martin commented on Dec 4, 2019

Thanks, that corrected the issue. I appreciate the fast response!

KoolReport commented on Dec 4, 2019

You are welcome :)

Ed Martin commented on Dec 5, 2019

I have been working through the examples to learn more about how to integrate Koolreport into my projects. I was working on the Amazing themes example and ran into a similar issue with the path.

A PHP Error was encountered Severity: Warning Message: fopen(../../../databases/customer_product_dollarsales2.csv): failed to open stream: No such file or directory Filename: datasources/CSVDataSource.php Line Number: 131

I configured the MyReport.php file like so:

<?php require_once APPPATH."../vendor/autoload.php";

class MyReport extends \koolreport\KoolReport {

use \koolreport\amazing\Theme;
public function settings()
{
    return array(

  "dataSources"=>array(
    "sales"=>array(
        "class"=>'\koolreport\datasources\CSVDataSource',
        "filePath"=>"../../../databases/customer_product_dollarsales2.csv",
        "fieldSeparator"=>";"
            ),
        ),
    );
}

}

I tried several changes to the class statement and filepath, but have not made progress. I was hpopign to a bit of assitance with this, thanks.

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
solved

None