Dear Support, I have been working with CustomDrillDown. I can display the first level of results but I can't go to the next one. There's no active fields (last_name) that I could click on. Here's my code:
//MaClasse_all.php - first level
<?php
require_once "../koolreport/autoload.php";
class MaClasse_all extends \koolreport\KoolReport
{
function settings()
{
include "param_connexion_database.php";
return $database_connection;
}
function setup()
{
$this->src("database")
->query('SELECT p.last_name, p.first_name, count(i.start_date)
from
intervention i
group by
p.last_name, p.first_name limit 30')
->pipe($this->dataStore("result_view_all"));
//MaClasse_all.view.php
<?php
use \koolreport\widgets\koolphp\Table;
$drilldown = $this->params["@drilldown"]
?>
<level-title>Tous les collaborateurs</level-title>
<?php
Table::create(array(
"dataSource"=>$this->dataStore("result_view_all"),
"clientEvents"=>array(
"itemSelect"=>"function(params){
$drilldown.next({last_name:params.selectedRow[0]});
}"
)
))
?>
//MaClasse_user - second level
<?php
require_once "../koolreport/autoload.php";
class MaClasse_user extends \koolreport\KoolReport
{
function settings()
{
include "param_connexion_database.php";
return $database_connection;
}
function setup()
{
$this->src("database")
->query('SELECT p.last_name, p.first_name,i.start_date
from
intervention i
where
p.last_name like :last_name
->params(array(
":last_name"=>$this->params["last_name"]
))
->pipe($this->dataStore("result_view_user"));
}
}
?>
//MaClasse_user.view
<?php
use \koolreport\widgets\koolphp\Table;
$drilldown = $this->params["@drilldown"]
?>
<level-title>Présences de <?php echo $this->params["last_name"]; ?></level-title>
<?php
Table::create(array(
"dataSource"=>$this->dataStore("result_view_user"),
))
?>
//MainReport
<?php
require_once "../koolreport/autoload.php";
class MainReport extends \koolreport\KoolReport
{
use \koolreport\clients\Bootstrap;
use \koolreport\core\SubReport;
function settings()
{
return array(
"subReports"=>array(
"all_users"=>MaClasse_all::class,
"one_user"=>MaClasse_user::class
)
);
}
function setup()
{
}
}
?>
//MainReport.view
<?php
//MainReport.view.php
use \koolreport\drilldown\CustomDrillDown;
require_once "MaClasse_all.php";
require_once "MaClasse_user.php";
?>
<html>
<head>
<title> Présences </title>
</head>
<body>
<?php
CustomDrillDown::create(array(
"name"=>"main_report",
"title"=>"Presences des collaborateurs mainreportview",
"subReports"=>array("all_users","one_user"),
))
?>
```
</body>
</html>
//index.php
<?php
require_once "MainReport.php";
$report = new MainReport();
$report->run()->render();
?>
I can't see what is wrong. Thank you in advance for your help.