KoolReport's Forum

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

Pivot Excel download does not work after upgrade. #543

Open Eo Yoonmin opened this topic on on Dec 3, 2018 - 3 comments

Eo Yoonmin commented on Dec 3, 2018

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',
        ),
    ));
}
David Winterburn commented on Dec 3, 2018

Hi Yoonmin,

We acknowledged this bug in the new version of KoolReport. Please send an email to our support@koolphp.net, we will send you the newest version of pivot excel export which addresses this bug. Thanks!

Eo Yoonmin commented on Dec 4, 2018

piyongsy@nate.com

Hi great team! Please send me debugging code. Thanks a lot

Eo Yoonmin commented on Dec 4, 2018

Great! It works very well after applying it to your code. Thanks!

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
solved

None