KoolReport's Forum

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

Need more than one DataSource #2620

Closed Peter Wendel opened this topic on on Mar 28, 2022 - 1 comments

Peter Wendel commented on Mar 28, 2022

Hello!

I created succesfull a dashboard according to your "QuickStart".

Just now I wonder how I can use more then one database for getting my reports done.

for example I have table "a" with following connection:

"connectionString"=>"mysql:host=localhost;dbname=am;",
            "username"=>"root",
            "password"=>"poweroot",
            "charset"=>"utf8"

and table "b" with the following configuration:

"connectionString"=>"mysql:host=localhost;dbname=import;",
            "username"=>"root",
            "password"=>"poweroot",
            "charset"=>"utf8"

Two different DB-names in one connection.

Do I have to set up a AutoMaker-Class for all of them?

I use a Laravel-Framework.

Regards, Peter

KoolReport commented on Mar 28, 2022

You create 2 datasource "Am" and "Import" with settings:

class Am extends MySQL
{
    ...
}
class Import extends MySQL
{
    ...
}

Later in any dataSource() function of widget, you can use Am::table(..) or Import::table(..) to query from those datasource.

Let us know if you need further assistance.

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