Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Pivottable::create(array(
"dataStore" => isset($this->params["code"]) ? $this->dataStore("sales") : [],
"serverPaging" => true,
//"template" => "Pivottable-Bun",
// "hideSubtotalRow" => true,
"FixedHeader" => true,
"hideSubtotalColumn" => true,
"showDataHeaders" => true,
"rowDimension" => "row",
"measures" => array(
"SALEVOL - sum",
"SALEVAL - sum",
"PLNVOL - sum",
"PLNVAL - sum",
"SALEVOLC - sum",
"SALEVALC - sum",
"PDBVOL - sum",
"PDBVAL - sum",
),
// "rowSort" => array(
// "TOTUSERSCH - sum" => "desc",
// "USERVOL - sum" => "desc",
// ),
// "columnSort" => array(
// 'TOTUSERSCH' => function ($a, $b) {
// return (int) $a < (int) $b;
// },
// ),
"rowCollapseLevels" => array(0,1,2),
"totalName" => "All",
'waitingFields' => array(
'SALEVOL - sum' => 'data',
'SALEVAL - sum' => 'data',
'PLNVOL - sum' => 'data',
'PLNVAL - sum' => 'data',
'SALEVOLC - sum' => 'data',
'SALEVALC - sum' => 'data',
'PDBVOL - sum' => 'data',
'PDBVAL - sum' => 'data',
'SUBJECTNM' => 'label',
'SERIESNM' => 'label',
),
"width" => "100%",
'paging' => array(
'size' => 20
),
// "nameMap" => array(
// "TOTUSERSCH - sum" => "Total User School",
// "USERVOL - sum" => "Total User Volume",
// ),
// "map" => array(
// "rowField" => function($rowField, $fieldInfo) {
// $v = $rowField;
// if ($v === "BOARD")
// $v = "BOARD";
// else if ($v === "SUBJECTNM")
// $v = "SUBJECT";
// else if ($v === "SERIESNM")
// $v = "SERIES";
// return $v;
// },
// "columnField" => function($colField, $fieldInfo) {
// $v = $colField;
// if ($v === "TOTUSERSCH - sum")
// $v = "USER SCHOOL";
// else if ($v === "USERVOL - sum")
// $v = 'USER VOLUME';
// return $v;
// },
// ),
'headerMap' => function($v, $f) {
switch ($v) {
case "SALEVOL - sum": return "2021-22 Net Volume Sale";
case "SALEVAL - sum": return "2021-22 Net Value Sale";
case "PLNVOL - sum": return "2022-23 Planned Volume";
case "PLNVAL - sum": return "2022-23 Planned Value";
case "SALEVOLC - sum": return "2022-23 Net Volume Sale";
case "SALEVALC - sum": return "2022-23 Net Value Sale";
case "PDBVOL - sum": return "2022-23 PDB Volume";
case "PDBVAL - sum": return "2022-23 PDB Value";
case 'SCNAME': return 'SCHOOL NAME';
case 'SUBJECTNM': return 'SUBJECT NAME';
case 'SERIESNM': return 'SERIES NAME';
}
$r = $v;
// if ($f === 'orderYear')
// $r = 'Year ' . $v;
// $map = array(
// '1' => 'January',
// '2' => 'February',
// '3' => 'March',
// '4' => 'April',
// '5' => 'May',
// '6' => 'June',
// '7' => 'July',
// '8' => 'August',
// '9' => 'September',
// '10' => 'October',
// '11' => 'November',
// '12' => 'December',
// );
// if ($f === 'orderMonth')
// $r = $map[$v];
return $r;
},
'cssClass' => array(
"table" => "table table-bordered table-striped table-hover cssText is-datatable krpmDataFieldZone krpmFieldDropContainer krpmRowFieldZone krpmFieldDropContainer krpmDataFieldZone krpmRowHeaderZoneDiv",
//"table" => "table table-bordered table-striped table-hover pivot-data-field-content pivot-data-field-zone pivot-row-header-total .pivot-row-header-text pivot-column-header-total .pivot-column-header-text pivot-column-header-grand-total",
'waitingField' => function($field, $fieldInfo) {
return "cell-class-name";
},
'dataField' => function($field, $fieldInfo) {
return "cell-class-name1";
},
'columnField' => function($field, $fieldInfo) {
return "cell-class-name1";
},
'rowField' => function($field, $fieldInfo) {
return "cell-class-name1";
},
'columnHeader' => function($header, $headerInfo) {
return "cell-class-name1";
},
'rowHeader' => function($header, $headerInfo) {
return "cell-class-name";
},
'dataCell' => function($value, $cellInfo) {
return "cell-class-name1";
},
),
'partialProcessing'=>true,
));
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo