Closed BernhardK91 closed 5 years ago
May you post the whole error?
Good Morning and thank you for your fast response.
Here is the full error:
Undefined offset: 0 (View: D:\Projekte\[...]\resources\views\crm\customer\overview.blade.php)
And here is the relevant code:
Table::create([
[...]
"grouping"=>array(
"AUFTRAG_NUMMER"=>array(
"calculate"=>array(
"{sumPrice}" => array("sum","TOTAL_PRICE"),
"{AU}" => function($store) {
return "Auftrags-Nr. " . $store->data()[0]['AUFTRAG_NUMMER'] . " vom " .
date('d.m.Y',strtotime($store->data()[0]['AU_DATUM']));
},
[...]
),
),
'columns' => [
[...]
],
]);
Thank you in advance!
It is actually a bug that we have fixed but have not released yet. The bug report was here.
Please download the new Table.tpl.php file and help us to replace the old file in \koolreport\src\widgets\koolphp" folder.
Let me know if it solves the issue.
I see I can handle the Undefined offset in my function like:
if(isset($store->data()[0])) {
return "Auftrags-Nr. " . $store->data()[0]['AUFTRAG_NUMMER'] . " vom " .
date('d.m.Y', strtotime($store->data()[0]['AU_DATUM']));
}
return "";
But when I do so, I am getting the following Error:
Undefined variable: i in D:\Projekte\[...]\vendor\koolphp\koolreport\src\widgets\koolphp\Table.tpl.php
The dataStore is empty in that case, and I think that is the reason for that Error.
Have you been able to replace the file? Does it work?
It is actually a bug that we have fixed but have not released yet. The bug report was here.
Please download the new Table.tpl.php file and help us to replace the old file in \koolreport\src\widgets\koolphp" folder.
Thank you very much! That fixed the "Undefined variable: i"-Issue. In combination with my error handling in the function that issue is completely solved!
Thanks a lot and Merry Christmas!
Merry Christmas!
Hey there,
I am getting an "Undefined offset: 0"-Error when the result is empty. Is there a way to handle empty results?
Thank you in advance!