KoolReport's Forum

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

Custom Error template instead of php error datasource required for .... #1848

Closed ankit raj opened this topic on on Jan 17, 2021 - 1 comments

ankit raj commented on Jan 17, 2021

Hi , I wanted to know how should I implement a custom div or user friendly message when the datasource is empty or some error occurs inside Koolreport rendering due to data. Right now it is the orange color standard php error . Is there an attribute from which we can show a custom div when an error occurs while rendering?

KoolReport commented on Jan 18, 2021

Hi Ankit, you can do as following:

<?php
if($this->dataStore("yourdataStore")->count()>0)
{
    Table::create([
        "dataSource"=>$this->dataStore("yourdataStore")
    ]);
}
else
{
    echo "Your custom message here";
}
?>

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
help needed

None