KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

PHP error when no data in Pivot #268

Open michelp opened this topic on on Apr 30, 2018 - 3 comments

michelp commented on Apr 30, 2018

Hi,

when I run a Pivot report, and no data is available, I get

A	PHP	Error	was	encountered Severity:	Warning Message:	array_keys()	expects	parameter	1	to	be	array,	null	given F ilename:	pivot/PivotUtil.php Line	Number:	53

How can I show just "no data to display" when there is no data in the datastore?

Thanks

KoolReport commented on Apr 30, 2018

Could you please do this:

if($this->dataStore("dataStoreName")->countData()>0)
{
    Pivot::create(array(
        "dataStore"=>$this->dataStore("dataStoreName"),
        ...
    ));
}

Let us know if it helps.

michelp commented on Apr 30, 2018

That works. Thanks!!!

KoolReport commented on Apr 30, 2018

Awesome! FYI, I will tell Pivot maker to take care of this case automatically. I will keep you update.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

Pivot