Hello all. I'm starting to use Kool Report effectively because I'm replacing Kool PHP with Kppl Reports in the Analytics part ...
In fact, I am trying but to no avail.
I made a connection to my local MariaDB and everything seems to be right, however it does not render the view correctly.
I used as my first example, the datasource type report.
Can you help me ?
<?php
require_once "../../../load.koolreport.php";
use \koolreport\KoolReport;
use \koolreport\processes\Filter;
use \koolreport\processes\TimeBucket;
use \koolreport\processes\Group;
use \koolreport\processes\Limit;
class intelliti_iqa extends KoolReport
{
public function settings()
{
//Get default connection from config.php
$config = include "../../../config.php";
return array(
"dataSources"=>array(
"intelliti_iqa"=>$config["iqa"]
)
);
}
protected function setup()
{
$this->src('intelliti_iqa')
->query("SELECT data_venda, vendas FROM v_vendas_ly_calc_date")
->pipe(new TimeBucket(array(
"data_venda"=>"month"
)))
->pipe(new Group(array(
"by"=>"data_venda",
"sum"=>"vendas"
)))
->pipe($this->dataStore('vendas_mensais'));
}
}
See the View Bellow
<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\ColumnChart;
?>
<div
<h1>Meu Teste Maria DB</h1>
<p Este Report está rodando em meu MariaDB Local (local)</p>
<?php
ColumnChart::create(array(
"dataStore"=>$this->dataStore('vendas_mensais'),
"columns"=>array(
"data_venda"=>array(
"label"=>"Periodo",
"type"=>"datetime",
"format"=>"Y-n",
"displayFormat"=>"F, Y",
),
"vendas"=>array(
"label"=>"Vendas",
"type"=>"number",
"prefix"=>"R$",
)
),
"width"=>"100%",
));
?>
<?php
Table::create(array(
"dataStore"=>$this->dataStore('vendas_mensais'),
"columns"=>array(
"data_venda"=>array(
"label"=>"Periodo",
"type"=>"datetime",
"format"=>"Y-n",
"displayFormat"=>"F, Y",
),
"vendas"=>array(
"label"=>"Vendas",
"type"=>"number",
"prefix"=>"R$",
)
),
"cssClass"=>array(
"table"=>"table table-hover table-bordered"
)
));
?>
</div>
And now, the terrible result ...
Thank You