KoolReport's Forum

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

Unable to load or run bootstrap and chart in my office system #1894

Open Abhishek opened this topic on on Feb 4, 2021 - 3 comments

Abhishek commented on Feb 4, 2021

Respected Sir/Madam, As I have previously mentioned that I am unable to run or load the bootstrap and chart in my office system so could please help me to sort the issue.

Thanks in advance and please help me to solve the issue.

errors

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;
?>

<div class="report-content">
    <div class="text-center">
        <h1>Sales By Customer</h1>
        <p class="lead">This report shows top 10 sales by customer</p>
    </div>

    <?php
    BarChart::create(array(
           "dataStore"=>$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",
            )
        ));
    ?>
    <?php
    Table::create(array(
        "dataStore"=>$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"
        )
    ));
    ?>
</div>

David Winterburn commented on Feb 4, 2021

Hi,

Would you please provide the file and directory structure of your project where it resides regarding your web server root?

Abhishek commented on Feb 4, 2021

C:\xampp\htdocs\test\salesreport---> My project path C:\xampp\htdocs\test---> Vendor folder present

David Winterburn commented on Feb 4, 2021

What is the url address of your report page?

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