Pivot Excel download does not work after upgrade from koolreport_pro_2.78.0 to koolreport_pro_3.1.0. When I download Pivot Excel, I get the following error.
A PHP Error was encountered
Severity: Notice
Message: Undefined index: rowNodesMark
Filename: pivot/PivotExcelExport.php
Line Number: 83
Salespivot.php
class Salespivot extends App_Controller {
...
public function toexcel()
{
$report = new Rsalespivot;
$report->run()->exportToExcel(array(
"dataStores" => array(
'result' => array(
'rowDimension' => 'row',
'columnDimension' => 'column',
)
)
))->toBrowser("salespivot.xlsx");
}
Rsalespivot.php
class Rsalespivot extends \koolreport\KoolReport
{
use \koolreport\excel\ExcelExportable;
->pipe(new Pivot(array(
"dimensions"=>array(
"column"=>"write_date, new_write_date",
"row"=>"cust_name"
),
"aggregates"=>array(
"sum"=>"amount"
)
Rsalespivot.view.php
<?php
if($this->dataStore("result")->countData()>0)
{
PivotTable::create(array(
"dataStore"=>$this->dataStore('result'),
'rowDimension'=>'row',
'columnDimension'=>'column',
'headerMap' => array(
'amount - sum' => 'amout',
'qty - sum' => 'qty',
),
'rowSort' => array(
'amount - sum' => 'desc',
),
));
}