KoolReport's Forum

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

Class Group (Sort, Limit etc.) not found --> Probably path to the Class wrong??? #59

Open bysystem opened this topic on on Aug 4, 2017 - 3 comments

bysystem commented on Aug 4, 2017

Dear koolreport support team,

first of all thx a lot for this great tool!

I have a test XAMMP environment on a Windows10 PC running with apache and MySQL.

I started with the basic example and but the first run of index.php brings the following error message:

"Fatal error: Uncaught Error: Class 'Sort' not found in C:\xampp\htdocs\AutoRep_Nikon\SalesByCustomer.php:30 Stack trace: #0 C:\xampp\htdocs\AutoRep_Nikon\koolreport\KoolReport.php(31): SalesByCustomer->setup() #1 C:\xampp\htdocs\AutoRep_Nikon\index.php(4): koolreport\KoolReport->__construct() #2 {main} thrown in C:\xampp\htdocs\AutoRep_Nikon\SalesByCustomer.php on line 30"

If I comment out the the section -->pipe (new Sort ... and -_>pipe(new Limit... in "SalesByCustomer.php" then the report will be generated fine (of course without sorting and limit functionality :-( <?php require_once "koolreport/autoload.php"; use \koolreport\processes\Group;

class SalesByCustomer extends \koolreport\KoolReport {

public function settings()
{
    return array(
        "dataSources"=>array(
            "sales"=>array(
                "connectionString"=>"mysql:host=localhost;dbname=nikon_autorep_test",
                "username"=>"root",
                "password"=>"",
                "charset"=>"utf8"
            )
        )
    );
}

public function setup()
{
    $this->src('sales')
    ->query("SELECT KdOrt,Umsatz FROM autorep_v")
    ->pipe(new Group(array(
        "by"=>"KdOrt",
        "sum"=>"Umsatz"
    )))
	/*
    ->pipe(new Sort(array(
        "Umsatz"=>"desc"
    )))
    ->pipe(new Limit(array(10))) */
    ->pipe($this->dataStore('autorep_v'));
}

}

My folder structor is as follows: C:\xampp\htdocs\AutoRep_Nikon

      --> examples/
      --> koolreport/
            example.css
            index.php
            SalesByCustomer.php
            SalesByCustomer.view.php

Any hint for me to fix this?

Kind regrds, bysystem

KoolReport commented on Aug 4, 2017

In your code, you have:

use \koolreport\processes\Group;

so you can use the Group. In the same manner, you put:

use \koolreport\processes\Sort;
use \koolreport\processes\Limit;
bysystem commented on Aug 4, 2017

Wooow! So easy :-)

Thx a lot, it works fine for me now!!

KoolReport commented on Aug 4, 2017

Awesome, any issue please let us know. We are glad to assist you.

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
solved

None