KoolReport's Forum

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

Fatal error: Uncaught Error: Class 'koolreport\core\Node' not found in #2606

Open Savathun opened this topic on on Mar 7, 2022 - 6 comments

Savathun commented on Mar 7, 2022

Dear Team, i download koolreport and unzip it but it show me below error

Fatal error: Uncaught Error: Class 'koolreport\core\Node' not found in C:\xampp1\htdocs\reports\salereport\koolreport\core\src\core\DataSource.php:25 Stack trace: #0 C:\xampp1\htdocs\reports\salereport\koolreport\core\autoload.php(29): include_once() #1 [internal function]: {closure}('koolreport/core...') #2 C:\xampp1\htdocs\reports\salereport\koolreport\core\src\datasources\PdoDataSource.php(45): spl_autoload_call('koolreport\\core...') #3 C:\xampp1\htdocs\reports\salereport\koolreport\core\autoload.php(29): include_once('C:\\xampp1\\htdoc...') #4 [internal function]: {closure}('koolreport/data...') #5 C:\xampp1\htdocs\reports\salereport\koolreport\core\src\KoolReport.php(264): spl_autoload_call('koolreport\\data...') #6 C:\xampp1\htdocs\reports\salereport\SaleReport.php(33): koolreport\KoolReport->src('automaker') #7 C:\xampp1\htdocs\reports\salereport\koolreport\core\src\KoolReport.php(100): SaleReport->setup() #8 C:\xampp1\htdocs\reports\salereport\index.php(6): koolreport\KoolReport->__construct() #9 {main} thrown in C:\xampp1\htdocs\reports\salereport\koolreport\core\src\core\DataSource.php on line 25

index.php

<?php
require_once "autoload.php";
require_once "SaleReport.php";


$report = new SaleReport;

$report->run()->render();

SaleReport.php

<?php
    require_once __DIR__."\koolreport\core\autoload.php";
   require_once __DIR__."\koolreport\core\src\KoolReport.php";
use \koolreport\KoolReport;
use \koolreport\processes\Filter;
use \koolreport\processes\TimeBucket;
use \koolreport\processes\Group;
use \koolreport\processes\Limit;


class SaleReport extends KoolReport{
//create setting
protected function settings()
{
    return array(
        "dataSources"=>array(
            "automaker"=>array(
                "connectionString"=>"mysql:host=localhost;dbname=automaker",
                "username"=>"root",
                "password"=>"",
                "charset"=>"utf8mb4_general_ci"

            )
            

        )
    );
}

protected function setup()
{
    $this->src("automaker")
    ->query(" 
        SELECT customers.CustomerName, sum(payment.ammount) as saleamount
        FROM payment
        JOIN customers ON customers.customer_number = payment.customer_number
        GROUP BY customers.customerName

    
    ")

    ->pipe($this->dataStore("result"));
}
}
Sebastian Morales commented on Mar 8, 2022

May I ask which is in the file "autoload.php" in your index.php:

require_once "autoload.php";

Can you pls try to remove it and see if there's still error with KoolReport?

Savathun commented on Mar 8, 2022

Hi,

Now my index.php is like

<?php require_once DIR."\koolreport\core\autoload.php"; require_once "SaleReport.php";

$report = new SaleReport;

$report->run()->render();


now also i get same error that node class not found

Savathun commented on Mar 8, 2022

also remove autoload.php from index .. it shows same fatal error

<?php require_once "SaleReport.php";

$report = new SaleReport;

$report->run()->render();

Sebastian Morales commented on Mar 8, 2022

1 . Pls try to remove this line as well:

require_once __DIR__."\koolreport\core\src\KoolReport.php";

Just require "koolreport\core\autoload.php" should be enough.

2 . Try to change all backward slashes () in your requiire to forward slashes (/):

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

3 . See if the file koolreport/core/src/core/Node.php exists and its path is case sensitively correct if your operating system is Linux instead of Windows/MacOS.

Savathun commented on Mar 8, 2022

I m using winows one , i changed the file error is same and the Node.php is exactly there in which location u addressed . now my code is

<?php
    require_once __DIR__."/koolreport/core/autoload.php";

use \koolreport\KoolReport;
use \koolreport\processes\Filter;
use \koolreport\processes\TimeBucket;
use \koolreport\processes\Group;
use \koolreport\processes\Limit;



class SaleReport extends KoolReport{
//create setting
protected function settings()
{
    return array(
        "dataSources"=>array(
            "automaker"=>array(
                "connectionString"=>"mysql:host=localhost;dbname=automaker",
                "username"=>"root",
                "password"=>"",
                "charset"=>"utf8mb4_general_ci"

            )
            

        )
    );
}

but still same node error ...can you come in to my anydesk : 181 467 810

Sebastian Morales commented on Mar 8, 2022

There could have been file problem with your download and unzip of KoolReport. Pls try to install KoolReport with composer:

Get Started With KoolReport - YouTube

Then require_once "vendor/autoload.php" and see if this error remains. 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
None yet

None