We generate a report and there is not show anything in the table, only report structure is visible without data. like bellow pic.
For reference here i mention the code we run.
$jobsheet = $this->src('mysql')->query($Query1); // 25796 record
$attandance = $this->src('mysql')->query($Query2); // 4392 record
$delimiter = " || ";
$join = new Join($jobsheet,$attandance,array("engg_reassigned_to"=>"engg_reassigned_to"));
$join->pipe(new Pivot2D(array(
"dimensions"=>array(
"column" => "dateyear",
"row" => "users_zone_c, address_state, CSCName,engName",
),
"aggregates"=>array(
"sum" => "ProductiveJS, workingDays, Average",
),
"fieldDelimiter" => $delimiter,
)))
->pipe(new Map(array(
'{value}' => function ($row) use ($delimiter) {
foreach ($row as $colName => $colValue) {
$colFields = substr($colName, 0, strrpos($colName, " || "));
$customAverageColName = $colFields . " || Average - sum";
if($customAverageColName!==' || Average - sum'){
$row[$customAverageColName] = $row[$colFields . " || ProductiveJS - sum"] != 0 ? $row[$colFields . " || ProductiveJS - sum"] / $row[$colFields . " || workingDays - sum"] : 0;
}
}
return $row;
},
'{meta}' => function($meta) {
$meta['columns']['Average - sum'] = array(
'type' => 'number',
'decimals' => 2,
);
return $meta;
}
)))
->pipe($this->dataStore('productivity'));
I also try to fix the issue and found that if
$this->dataStore('productivity')->data();
does not return anything then koolreport not show anything. in my case it is not show anything but array(0) { }
buy my both queries are run successfully in sql and give me numbers of record. Please help us to fix this issue