Respected Madam/Sir, This are following errors i am facing and once again i would like to say you that i am able to retrieve the data but not able to display the chart and unable to apply bootstrap.
Not allowed to load local resource: file:///C:/xampp/htdocs/Cloud%20Clinic/salesreport/koolreport_assets/3409401219/KoolReport.js
Uncaught ReferenceError: KoolReport is not defined
Uncaught ReferenceError: KoolReport is not defined
<?php
require_once "../vendor/koolreport/core/autoload.php";
use \koolreport\processes\Group;
use \koolreport\processes\Sort;
use \koolreport\processes\Limit;
class SalesByCustomer extends \koolreport\KoolReport
{
use \koolreport\clients\bootstrap;
public function settings()
{
return array(
"dataSources"=>array(
"sales"=>array(
"connectionString"=>"mysql:host=localhost;dbname=db_sales",
"username"=>"root",
"password"=>"",
"charset"=>"utf8"
)
)
);
}
public function setup()
{
$this->src('sales')
->query("SELECT customerName,dollar_sales FROM customer_product_dollarsales2")
->pipe(new Group(array(
"by"=>"customerName",
"sum"=>"dollar_sales"
)))
->pipe(new Sort(array(
"dollar_sales"=>"desc"
)))
->pipe(new Limit(array(10)))
->pipe($this->dataStore('sales_by_customer'));
}
}
?>
<?php
use \koolreport\widgets\google\BarChart;
use \koolreport\widgets\koolphp\Table;
?>
Sales By Customer
This report shows top 10 sales by customer
$this->dataStore('sales_by_customer'),
"width"=>"100%",
"height"=>"500px",
"columns"=>array(
"customerName"=>array(
"label"=>"Customer"
),
"dollar_sales"=>array(
"type"=>"number",
"label"=>"Amount",
"prefix"=>"$",
"emphasis"=>true
)
),
"options"=>array(
"title"=>"Sales By Customer",
)
));
?>
$this->dataStore('sales_by_customer'),
"columns"=>array(
"customerName"=>array(
"label"=>"Customer"
),
"dollar_sales"=>array(
"type"=>"number",
"label"=>"Amount",
"prefix"=>"$",
)
),
"cssClass"=>array(
"table"=>"table table-bordered table-striped"
)
));
?>