Introduction #

PdoDataSource is the default datasource in KoolReport. This datasource helps you to connect to various databases such as MySQL, SQL Server, Oracle and many others.

Supported Databases:

  • MS SQL Server (PDO)
  • Firebird (PDO)
  • IBM (PDO)
  • Informix (PDO)
  • MySQL (PDO)
  • MS SQL Server (PDO)
  • Oracle (PDO)
  • ODBC and DB2 (PDO)
  • PostgreSQL (PDO)
  • SQLite (PDO)
  • 4D (PDO)

For more information of PDO, click here!

Settings #

connectionStringstringSet the PDO connection string
usernamestringUser login name
passwordstringUser password
charsetstring"utf8"Set the charset of database.

Methods #

query(string $str_query)PdoDataSourceThis method is used in report's setup() function. It will help to setup query string which will be excuted when report is run.
params(array $params)PdoDataSourceThis method is used to set list of parameters for query statement

Example #

class MyReport extends \koolreport\KoolReport
    public function settings()
        return array(

    public function setup()
        ->query("SELECT * FROM tblPurchase where status=:status")

In above example, we query all data from table tblPurchase of "mysql_datasource". The query result will be piped through many processes in between until it reaches the final data store called "purchase_summary".