Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
<?php
$data = array(
array("country"=>"US","amount"=>50000),
array("country"=>"Canada","amount"=>31000),
array("country"=>"Mexico","amount"=>42000),
);
require_once "../koolreport/autoload.php";
use \koolreport\instant\Widget;
use \koolreport\scr\widgets\google\PieChart;
Widget::create(PieChart::class,array(
"data"=>$data
));
?>
You need to require_once correctly the path to the koolreport/autoload.php file. You may use the dirname()
to make sure the require file is correct.
require_once dirname(__FILE__)."/../koolreport/autpload.php";
As long as the autoload.php is loaded, you can use everything in koolreport library.
About the chart class name, believe us, we made it so the correct namespace is
use \koolreport\widgets\google\PieChart;
without "src".
I´m sure require_once "../koolreport/autoload.php"; is ok. autoload.php is loaded... the path is correct...
$data111 = array(
array("country"=>"US","amount"=>50000),
array("country"=>"Canada","amount"=>31000),
array("country"=>"Mexico","amount"=>42000),
);
require_once "../koolreport/autoload.php";
use \koolreport\instant\Widget;
use \koolreport\widgets\google\PieChart;
Widget::create(PieChart::class,array(
"data"=>$data111
));
I still recieve this msg... Fatal error: Uncaught Error: Class 'koolreport\instant\Widget' not found in C:\xampp\htdocs\CRM\Kool_1.php:42 Stack trace: #0 {main} thrown in C:\xampp\htdocs\CRM\Kool_1.php on line 42
It can´t find instant widget... Can´t find what is missing...
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo