KoolReport's Forum

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

Uncaught error while importing excel file #1392

Closed ankit raj opened this topic on on Apr 17, 2020 - 4 comments

ankit raj commented on Apr 17, 2020

I got the error

Uncaught Error: Class 'PhpOffice\PhpSpreadsheet\IOFactory' not found in ...\vendor\koolreport\core\src\excel\ExcelDataSource.php:91.

this is my calling:

use \koolreport\excel\ExcelDataSource;
class saleReport extends \koolreport\koolreport
{
    use \koolreport\clients\jQuery;
    use \koolreport\clients\Bootstrap;
    use \koolreport\clients\BootstrapCSS;
    
    public function settings()
    {
        return array(
            "dataSources" => array(
                "check"=>array(
                    'filePath' => 'excel-data.xlsx',
                     "class"=>ExcelDataSource::class,     
                ), 
            )
        );
    }

    protected function setup()
    {
        $this->src("check")
        ->pipe($this->dataStore("check"));

    }
}
David Winterburn commented on Apr 17, 2020

Hi,

Please install composer on your machine, open the command line, go to the Excel package folder and run the following command:

composer install

Let us know if you have any difficulty. Thanks!

ankit raj commented on Apr 17, 2020

Hey i followed the steps exactly , still i get the same error. also just to be sure, i have kept excel folder here \vendor\koolreport\core\src. its supposed to be here only na?

David Winterburn commented on Apr 17, 2020

Hi,

You should not keep the package source in koolreport/core/src. Instead extract/install them in vendor/koolreport please. For example with excel it should be vendor/koolreport/excel. Thanks!

ankit raj commented on Apr 19, 2020

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

Excel