Hi,
I call :
require_once($file_class); $report=new Report(); $report->run()->exportToExcel(array( "dataStores" => array(
"measures"=>.......,
)))->toBrowser($file_export);
Call to undefined method Report::exportToExcel()
And the file class below, Thanks for your help.
<?php
use \koolreport\processes\Filter; use \koolreport\processes\ColumnMeta; use \koolreport\pivot\processes\Pivot; use \koolreport\excel\ExcelExportable;
class Report extends koolreport\KoolReport {
function settings()
{
return array(
"dataSources"=>array(
'mysource'=>array(
'class'=>'\koolreport\datasources\CSVDataSource',
'filePath'=> 'mycsv.csv',
'fieldSeparator' => ';',
"sheetName"=>"CA PAR COMMERCIAL",
"sheetIndex"=>0,
)
)
);
}
function test()
{
die("heel");
}
function setup()
{
$this->src("mysource") ->pipe(new ColumnMeta(array(
"Contract_month_cost"=>array(
"type" => "number",
),
)))
->pipe(new Pivot(array( "dimensions"=>array("column" => "Invoice|year_period,Invoice|month_period","row" => "Salesman|lastname,Agency|name", ),
"aggregates"=>array('sum' => 'Invoice|price,Invoice|recur_amount') ))) ->pipe($this->dataStore("mysource"));
}
public function render($view=null,$return=false)
{
if(is_file($view))
{
$content = "";
if($this->fireEvent("OnBeforeRender"))
{
ob_start();
$this->getResourceManager()->init();
$GLOBALS["__ACTIVE_KOOLREPORT__"] = $this;
include($view);
$content = ob_get_clean();
//Adding resource to content
if($this->fireEvent("OnBeforeResourceAttached"))
{
$this->getResourceManager()->process($content);
$this->fireEvent("OnResourceAttached");
}
$this->fireEvent("OnRenderEnd",array("content"=>&$content));
if($return)
{
return $content;
}
else
{
echo $content;
}
}
}
else
{
$this->debug();
}
}
} ?>