KoolReport's Forum

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

Dashboard: Create DataSource using API #2312

Closed Andre Van Der Walt opened this topic on on Sep 1, 2021 - 3 comments

Andre Van Der Walt commented on Sep 1, 2021

Hi,

Do you have an example of how to create a data source in Dashboard using API ?

Thank you,

Andre Van Der Walt commented on Sep 1, 2021

We store the data in an array, how does ArrayDataSource works in Dashboard?

KoolReport commented on Sep 1, 2021

In the dataSource() function, you can return an array of associate array, then it will works. For example:

protected function dataSource()
{
    return [
        ["name"=>"Peter","age"=>32],
        ["name"=>"John","age"=>38],
    ];
}

So there, you can make any connection to API of your own, as long as you return array, then it is fine.

Andre Van Der Walt commented on Sep 2, 2021

Great thank you!

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
solved

Dashboard