Hello KoolReport,
We need to implement drill down on table. We created two separate tables for this report. Below is the code for the report which is working with Level1 as ColumnChart and Level2 as Table. When clicked on ColumnChart, it does drill down to the table but when we replace the first level to table from ColumnChart then the Level1 table is displayed but drill down does not work on this table. Could you please let us know if drilldown is supported or not with first level as table?
<?php
DrillDown::create(array(
"name"=>"DrillDown",
"levels"=>array(
array(
"title"=>"All BusinessLines",
"content"=>function($params,$scope)
{
ColumnChart::create(array(
"dataSource"=>(
$this->src("DatabaseName")->query("
SELECT [businessLine]
,[recordDate]
,CONVERT(DECIMAL(15,0),[prevDayRevenue]) AS prevDayRevenue
,CONVERT(DECIMAL(15,0),[avg7DayRevenue]) AS avg7DayRevenue
FROM Level1
WHERE recordDate = (SELECT MAX(recordDate) FROM Level1)
")
),
"columns"=>array(
"businessLine",
"prevDayRevenue" =>array(
"type"=>"number",
"label"=>"prevDayRevenue",
"prefix"=>"$",
),
"avg7DayRevenue"=>array(
"type"=>"number",
"label"=>"avg7DayRevenue",
"prefix"=>"$",
),
),
"clientEvents"=>array(
"itemSelect"=>"function(params){
DrillDown.next({businessLine:params.selectedRow[0]});
}",
),
"cssClass"=>array(
"table"=>"table table-hover table-tr"
)
));
}
),
array(
"title"=>"All Advertisers",
"content"=>function($params,$scope)
{
Table::create(array(
"dataSource"=>(
$this->src("DatabaseName")->query("
SELECT [businessLine]
,advertiserName
,[recordDate]
,CONVERT(DECIMAL(15,0),[prevDayRevenue]) AS prevDayRevenue
,CONVERT(DECIMAL(15,0),[avg7DayRevenue]) AS avg7DayRevenue
FROM Level2
WHERE recordDate = (SELECT MAX(recordDate) FROM Level2)
AND businessLine = :businessLine
")
->params(array(
":businessLine"=>$params["businessLine"]
))
)
,
"columns"=>array(
"advertiserName",
"prevDayRevenue" =>array(
"type"=>"number",
"label"=>"prevDayRevenue",
"prefix"=>"$",
),
"avg7DayRevenue"=>array(
"type"=>"number",
"label"=>"avg7DayRevenue",
"prefix"=>"$",
),
)
));
}
)
),
"themeBase"=>"bs4",
));
?>
Thanks, Rajesh.