KoolReport's Forum

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

Fatal error: Uncaught Error: Call to undefined function koolreport\core\phpuniqid() #3445

Open Gustavo opened this topic on 6 days ago - 1 comments

Gustavo commented 6 days ago

Hi, I received this error:

The version of PHP and OS is: PHP 7.4.33 and Windows 10

Can someone help me?

This is my SalesByCustomer.php file: <?php

require_once "../koolreport/core/autoload.php"; require_once "../configBancoDados/config_db.php";

class SalesByCustomer extends \koolreport\KoolReport {

protected function settings()
{
    global $host_bd, $nome_bd, $usuario_bd, $senha_bd;
    return array(
        "dataSources"=>array(
            "mysql_datasource"=>array(
                "connectionString"=>"mysql:host=$host_bd;dbname=$nome_bd",
                "username"=>"$usuario_bd",
                "password"=>"$senha_bd",
                "charset"=>"utf8",
            ),
            "sales"=>array(
                "class"=>'\koolreport\datasources\CSVDataSource',
                "filePath"=>"orders.csv",
            ),
        )
    );
}

protected function setup()
{
    global $nome_bd;
    $this->src('mysql_datasource')
        ->query("SELECT customerName, dollarSales FROM $nome_bd.orders")
        ->params(array(":status"=>"completed"))
        ->pipe($this->dataStore('salesByCustomer'));
}

}

And here is my SalesByCustomer.view.php file:

<?php use \koolreport\widgets\koolphp\Table; use \koolreport\widgets\google\BarChart; ?>

Sales By Customer

This report shows top 10 sales by customer

$this->dataStore('salesByCustomer'), "width"=>"100%", "height"=>"500px", "columns"=>array( "customerName"=>array( "label"=>"Customer" ), "dollarSales"=>array( "type"=>"number", "label"=>"Amount", "prefix"=>"$", "emphasis"=>true ) ), "options"=>array( "title"=>"Sales By Customer", ) )); ?> $this->dataStore('salesByCustomer'), "columns"=>array("customerName","dollarSales"), )); ?>
Sebastian Morales commented 5 days ago

Pls let us know your koolreport/core version, which could be found in koolreport/core/composer.json file? If it's possible pls try update it to a newer version. Or you can edit the file koolreport/core/src/core/Utility.php and replace the 44th line with this one:

        return \uniqid() . Utility::$_uniqueId; //line 44

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