Introduction #

Although using PDODataSource can connect to SQL Server. However if for some reasons, you do not have the PDO Driver, you may use the old traditional connection to PostgreSQL using PostgreSQLDataSource.

Settings #

classstringMust set to '\koolreport\datasources\PostgreSQLDataSource'
hoststringHost of database
usernamestringYour login username
passwordstringYour password
dbnamestringDatabase name

Methods #

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

Example #

class MyReport extends \koolreport\KoolReport
    public function settings()
        return array(
                    'host' => 'localhost',
                    'username' => 'username',
                    'password' => 'psasword',
                    'dbname' => 'automaker',
                    'charset' => 'utf8',  
                    'class' => "\koolreport\datasources\PostgreSQLDataSource"  
    public function setup()
        ->query("SELECT * FROM tblPurchase where status=:status")