Thanks for the reply. I'm still having some difficulties. When I click on the status bar, it goes to the next report "DetailStatus.view" but it is always blank. What am I doing wrong?
MainReport
function settings() {
return array(
"subReports"=>array(
"name"=>"Status",
"title"=>"Trip by Status",
"statusSummary"=>StatusSummary::class,
"detailStatus"=>DetailStatus::class,
)
);
}
MainReport.view
\koolreport\drilldown\CustomDrillDown::create(array(
"status"=>"status",
"subReports"=>array("statusSummary","detailStatus"),
));
StatusSummary
function setup() {
$this->src('dataSource')
->query("SELECT status, count(*) as nb FROM SampleTable GROUP BY status")
->pipe($this->dataStore('status_summary'));
}
StatusSummary.view
ColumnChart::create(array(
"dataStore"=>$this->dataStore('status_summary'),
"clientEvents"=>array(
"itemSelect"=>"function(params){
$drilldown.next({status:params.selectedRow[0]});
}",
),
DetailStatus
function setup() {
$this->src('dataSource')
->query("SELECT * FROM SampleTable WHERE status=:status")
->params(array(
":status"=>$this->params["status"]
))
->pipe($this->dataStore('detail_report'));
}
DetailStatus.view
ColumnChart::create(array(
"dataSource"=>$this->dataStore("detail_report")