use koolreport\pivot\widgets\PivotTable;
PivotTable::create(array(
"dataSource" => $this->dataStore($this->reportName),
"rowDimension" => "row",
"columnDimension" => "column",
'measures' => array(
"WEIGHT - sum",
), //görünmesi istenen alanlar
'headerMap' => array(
'WEIGHT - sum' => 'Toplam Ağırlık',
),
'totalName' => 'Toplam',
'width' => '90%',
'map' => array(
'dataField' => function($dataField, $fieldInfo) {
if ($dataField === 'WEIGHT - sum')
return 'Atık Miktarı (Günlük Toplam)';
return '';
},
),
'paging' => array(
'size' => 5,
'maxDisplayedPages' => 5,
'sizeSelect' => array(5, 10, 20, 50, 100)
)
));
setup
$dataStore = $this->getDataSource()->query($this->query)->pipe(new ColumnMeta(array(
"WEIGHT"=>array(
'type' => 'float',
))));
$dataStore->pipe(new Pivot(array(
"dimensions" => array(
"column" => "TURNAME",
"row" => array("WYEAR", "WMONTH")
),
"aggregates"=>array(
"sum" => "WEIGHT",
"count"=>"WEIGHT"
),
)
))->pipe($this->dataStore($this->reportName));
When I download the report, the pivottable appears blank. I am using version 4.3.2. Can you help me?