KoolReport's Forum

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

Pivot in Codeigniter not good yet #553

Closed Mazmur opened this topic on on Dec 10, 2018 - 6 comments

Mazmur commented on Dec 10, 2018

Dear Koolreport,

Why in Create Pivot in Codeigniter not support to set row more than 2 field ?

Below is 2 field in row and fine :

->pipe(new Pivot(array(
		    'dimensions'=>array(
		    'row'=>'NmLang,NmBar'
		  ),

If more than 2, error child row :

->pipe(new Pivot(array(
		    'dimensions'=>array(
		    'row'=>'NmLang,NmBar,No_OK'
		  ),

I'm already create pivot in koolreport example without codeigniter with row more than 2 field, output is no problem.

Regards,

Mazmur

David Winterburn commented on Dec 10, 2018

Hi,

Please send us your error message with screenshots. Thanks!

Mazmur commented on Dec 10, 2018

Hi David,

This is screenshoots my error report with pivot in codeigniter :

David Winterburn commented on Dec 10, 2018

Thanks. Would you please post php code of both your report and the view files?

Mazmur commented on Dec 10, 2018

Code my Report :

->pipe(new Pivot(array(
		    'dimensions'=>array(
		    'row'=>'NmLang,NmBar,No_OK'
		  ),
		  'aggregates'=>array(
			'sum'=>'SaldoAkhir',
			'count'=>'SaldoAkhir'
		  )
		)))
		->pipe($this->dataStore("StockFG"));

my view :

 <?php
			  $dataStore = $this->dataStore('StockFG');
			  PivotTable::create(array(
				'dataStore'=>$dataStore,
				'rowDimension'=>'row',			
				'measures'=>array(
				  'SaldoAkhir - sum', 
				  'SaldoAkhir - count'
				),
				'rowSort' => array(
				  'SaldoAkhir - sum' => 'desc',
				),
				'rowCollapseLevels' => array(1),
				'totalName' => 'Total Stock',
				 'width' => '100%',
				'nameMap' => array(
				  'SaldoAkhir - sum' => 'Sales (in USD)',
				  'SaldoAkhir - count' => 'Number of Sales',
				),
				
			  ));
			?>
David Winterburn commented on Dec 11, 2018

Hi Mazmur,

Please send an email to support@koolphp.net. We will send you an updated version of the Pivot package to address your issue. Thanks!

Mazmur commented on Dec 11, 2018

Ok, Solved. Thank you

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
bug
help needed
solved

Pivot