Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Pls check our Table widget's footer property:
https://www.koolreport.com/examples/reports/koolphp_table/footer/
https://www.koolreport.com/docs/koolphp/table/#table-settings-aggregated-footer
You could use Map process in report setup to create meta's "footer" for any column you want:
//MyReport.php
->pipe(new Map(array(
"{meta}" => function($meta) {
$colMetas = $meta["columns"];
foreach ($colMetas as $colName => $colMeta) {
if ($footer_condition) $colMeta["footer"] = ...;
$colMetas[$colName] = $colMeta;
}
$meta["columns"] = $colMetas;
return $meta;
}
)))
Another option is to create your "columns" setting dynamically in your Table/DataTables widget:
$columnNames = ...;
$columnSettings = [];
foreach ($columnNames as $columnName) {
$columnSettings[$columnName] = [
...
"footer" => ...
];
}
Table::create([
...
"columns" => $columnSettings,
]);
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo