KoolReport's Forum

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

Instant not working #615

Closed Augusto opened this topic on on Jan 25, 2019 - 12 comments

Augusto commented on Jan 25, 2019

Hi There,

I´ve installed Instant Package, but I receive this msg...

Fatal error: Uncaught Error: Class 'koolreport\instant\Widget' not found in C:\xampp\htdocs\CRM\Kool_1.php:49 Stack trace: #0 {main} thrown in C:\xampp\htdocs\CRM\Kool_1.php on line 49

Augusto commented on Jan 25, 2019
<?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
	));
?>
Augusto commented on Jan 25, 2019

Any help?

KoolReport commented on Jan 26, 2019

Please check if the link to autoload.php is correct. Also please fix the PieChart namespace, it should be

use \koolreport\widgets\google\PieChart;
Augusto commented on Jan 28, 2019

Link to autoload.php is correct ! Shouldn´t be ? use \koolreport\scr\widgets\google\PieChart;

Augusto commented on Jan 28, 2019

If i don´t link to autoload, I receive this msg Warning: require_once(../koolreport/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\CRM\Kool_1.php on line 38

So, it is surely correct ! I did not receive this msg...

KoolReport commented on Jan 28, 2019

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".

Augusto commented on Jan 28, 2019

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...

KoolReport commented on Jan 28, 2019

Have you downloaded the instant packge from our site?

Augusto commented on Jan 28, 2019

Yes... and installation is quite simple...

KoolReport commented on Jan 28, 2019

it should be in "koolreport/packages" folder like this: "koolreport/packages/instant/Widget.php"

Augusto commented on Jan 28, 2019

Working !!! Tks a lot !!!

KoolReport commented on Jan 28, 2019

Awesome :)

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

Instant