I have oriented myself very much by the mysql example. I don't understand why I always get only one record as result, but the table contains more than one record. The example is so simple, what could be wrong? Thank you! :)
Report.php
class Report extends \koolreport\KoolReport
{
protected function settings()
{
return array(
"dataSources"=>array(
"tt"=>array(
"connectionString"=>"mysql:host=localhost;dbname=tt",
"username"=>"root",
"password"=>"",
"charset"=>"utf8"
),
)
);
}
protected function setup()
{
$this->src('tt')
->query("SELECT * FROM session")
->pipe(new Group(array(
"client_id"=>"Client-ID",
"therapist_id"=>"Therapist-ID"
)))
->pipe($this->dataStore('tt'));
}
}
Report.view.php
<?php
Table::create(array(
"dataStore"=>$this->dataStore('tt'),
"columns"=>array(
"therapist_id"=>array(
"type"=>"number",
"label"=>"Therapist ID",
),
"client_id"=>array(
"type"=>"number",
"label"=>"Client-ID",
)
),
"cssClass"=>array(
"table"=>"table table-hover table-bordered"
)
));
?>