koolreport
koolreport copied to clipboard
Undefined index filtering empty result
Hi there,
I am getting the following error:
Undefined index: DIFFERENZ (View: C:\[...]\resources\views\dashboard\fieldsales.blade.php)
The result of the SQL-query is empty and the problem is occured in the following line:
"dataSource" => $this->dataStore("customer.flop100.annualComparison")->filter('DIFFERENZ', '<', 0),
Thank you in advance!
I solved my problem with this workaround:
if ($this->dataStore("customer.flop100.annualComparison")->count() > 0) {
Table::create([
[...]
]);
} else {
echo '<i>no results</i>';
}
That's great. The Table actually detect the empty rows of datastore however the issue lies inside the filter() function which have problem if result is empty. May be it is better to return the datastore itself if there is no data.