Introduction #

ReportDataSource is a special data source which help to get data from another report. Let imagine we create a report that requires data already existed in another report. We want to connect to existed report and get those data rather than spending time to rewrite code. ReportDataSource will help you to do so.

Settings #

classstringMust set to '\koolreport\datasources\ReportDataSource'
reportstringThe full class name of source report you want to get data from.
paramsarrayarray()Parameters that will be inserted to source report when initiated
keystringThis is optional parameter. In case that you need to create more than one datasource from single source report (only difference in params) then you specify different key for each datasource.

Methods #

dataStore(string $name)ReportDataSourceThis function is used in setup() function of report. It specifies the name of data store in the source report we want to get data from.

Example #


require "HardwareSaleReport.php";
require "SoftwareSaleReport.php";

class TotalSaleReport extends \koolreport\KoolReport
    public function settings()
        return array(
    public function setup()
        ->dataStore('sale') //We want to get data from "sale" data store of HardwareSaleReport