KoolReport's Forum

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

Getting started with 1st report - 1 error coming #155

Open saurabh opened this topic on on Nov 27, 2017 - 14 comments

saurabh commented on Nov 27, 2017

My file structure is as follows

xampp>httpdocs>reports>index.php, SalesByCustomer.php, SalesByCustomer.view.php, koolreport folder

When i am running - http://localhost/reports/index.php

This is the error coming - Fatal error: Class 'Sort' not found in C:\xampp\htdocs\reports\SalesByCustomer.php on line 29

Note - I am using xampp and my PHP Version is 5.5.30 Please guide.

KoolReport commented on Nov 27, 2017

Hi,

Sorry for our mistake in the First Report example. Please add following line to the SaleReport.php

use \koolreport\processes\Sort;

You can add it after the line use \koolreport\processes\Group;

Here is the updated code First Report

Let us know if you need further assistance.

Regards,

KoolPHP Inc

saurabh commented on Nov 27, 2017

Fatal error: Class 'Limit' not found in C:\xampp\htdocs\reports\SalesByCustomer.php on line 33

KoolReport commented on Nov 27, 2017

That bad, not cool at all, please add also use \koolreport\processes\Limit;. Please download our examples as well, all of them are working ones.

saurabh commented on Nov 28, 2017

alright, 1st report is working now, i'll move next , my main requirement is to download pdf and excel files

Panagiotis Manolakos commented on Jan 18, 2019

Its seems for me that even the Koolreport class is also found "[Fri Jan 18 16:49:48.459827 2019] [:error] [pid 16902] [client 127.0.0.1:57168] PHP Fatal error: Class 'koolreport\koolReport' not found in /var/www/html/my_koolreport/SalesByCustomer.php on line 7, referer: http://localhost/". Just trying the first report example under Getting started page.

Its seems that this line is the issued: 7 class SalesByCustomer extends \koolreport\KoolReport

KoolReport commented on Jan 18, 2019

Beaware of case sensitive. The correct class is \koolreport\KoolReport

Panagiotis Manolakos commented on Jan 19, 2019

If you see from the code line, the case sensitive is correct. Same manner have from Cube class when trying this example: cube_customers_vs_categories

[19-Jan-2019 22:57:25 Europe/Berlin] PHP Fatal error:  Class 'koolreport\processes\Cube' not found in /Applications/MAMP/htdocs/my_koolreport/SalesCustomersProducts.php on line 34
KoolReport commented on Jan 20, 2019

I see in your error:

"[Fri Jan 18 16:49:48.459827 2019] [:error] [pid 16902] [client 127.0.0.1:57168] PHP Fatal error: Class 'koolreport\koolReport' not found in /var/www/html/my_koolreport/SalesByCustomer.php on line 7, referer: http://localhost/"

And the class was koolreport\koolReport with second letter "k" in lowercase.

For the second issue related to Cube, the correct class of Cube is \koolreport\cube\processes\Cube, please make sure that you have the Cube package.

Panagiotis Manolakos commented on Jan 20, 2019

Thanks a lot for your help. I fixed the case sensitive issue, but now I have another issue: here is my code (SalesByCustomer.php) as copied from example code:

<?php
        require_once "koolreport/autoload.php";
        use \koolreport\processes\Group;
        use \koolreport\processes\Sort;
        use \koolreport\processes\Limit;

        class SalesByCustomer extends \koolreport\KoolReport
        {
.........................

but still not found the class:

[Sun Jan 20 18:20:33.219734 2019] [:error] [pid 29101] [client 127.0.0.1:32926] PHP Fatal error:  Class 'koolreport\\KoolReport' not found in /var/www/html/my_koolreport/SalesByCustomer.php on line 7, referer: http://localhost/

for some reason a second backslash is added.

KoolReport class although existed in /var/www/html/my_koolreport/koolreport/src/KoolReport.php so maybe due to the second backslash, the code cannot find it.

Panagiotis Manolakos commented on Jan 20, 2019

Just found here: https://stackoverflow.com/questions/32083903/class-not-found-error-in-php-with-double-slashes that the double slashes output is just a way that php logging. So I cannot find any other reason that the code cannot find the class. As I just copied the code exactly from the example, the only thing that I can think is that maybe a config issue with PHP is took place here.

KoolReport commented on Jan 20, 2019

Could you please check if the require_once has correct path to autoload.php. By the way, what is version of your PHP?

Panagiotis Manolakos commented on Jan 20, 2019

Finally I found a solution. Its seems that has to do with folder koolreport permissions and file owner. I changed the owner of all files to those that run the Apache (www-data) and change the permissions to 755. PHP Version 7.0.32-0ubuntu0.16.04.1

KoolReport commented on Jan 20, 2019

Oh great! I see, so because of permission so the file could not be included.

Panagiotis Manolakos commented on Jan 20, 2019

Yes, indeed. Thanks a lot for your help!!

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