Hello,
I've got the same problem, that my table ist unformatted. It looks like
Second problem: The export function also doesn't work when I activate the last line in my protokoll_index.php (that means no PDF file is created).
Thanks for your help!
Rosita Johlke
I've done the following:
protokoll.php
<?php
require_once "koolreport/autoload.php";
use \koolreport\KoolReport;
use \koolreport\bootstrap3;
//use \koolreport\clients\Bootstrap;
class r_ah_protokoll extends KoolReport
{
use \koolreport\export\Exportable;
protected function settings()
{
return array(
"assets"=>array(
"path"=>"koolreport/bootstrap3/assets",
"url"=>"/assets"
),
"dataSources"=>array(
"dbt"=>array(
"connectionString"=>"mysql:host=localhost;dbname=buch",
"username"=>"root",
"password"=>"",
"charset"=>"utf8"
),
)
);
}
protected function setup()
{
$this->src('dbt')
->query("SELECT id, id_prot, pos_nr FROM ah_protokolle_pos")
->pipe($this->dataStore('ah_prot_pos'));
}
}
?>
protokoll.view.php
<?php
use \koolreport\widgets\koolphp\Table;
?>
Positionen
$this->dataStore('ah_prot_pos'),
"columns"=>array(
"id"=>array("label"=>"Id", "type"=>"number"),
"id_prot"=>array("label"=>"id_prot","type"=>"number"),
"pos_nr"=>array("label"=>"pos_nr","type"=>"number")
),
"cssClass"=>array("table"=>"table table-hover table-bordered")
));
?>
protokoll_index.php
<?php
require_once "r_ah_protokoll.php";
$report = new r_ah_protokoll;
$report->run()->render();
//$report->run()->export('r_ah_protokoll_pdf')->pdf(array("format"=>"A4","orientation"=>"portrait"))->toBrowser("ah_protokoll.pdf");
?>
protokoll_pdf.view.php
<?php
use \koolreport\widgets\koolphp\Table;
?>
<html>
<body style="margin:0.5in 1in 0.5in 1in">
<link rel="stylesheet" href="koolreport/bootstrap3/assets/core/css/bootstrap.min.css" />
<link rel="stylesheet" href="koolreport/bootstrap3/assets/core/css/bootstrap-theme.min.css" />
<div class="page-header" style="text-align:right"><i>Positionen</i></div>
<div class="page-footer" style="text-align:right">{pageNum}</div>
<div class="text-center">
<h1>Positionen</h1>
</div>
<hr/>
<?php
Table::create(array(
"dataStore"=>$this->dataStore('ah_prot_pos'),
"columns"=>array(
"id"=>array("label"=>"Id", "type"=>"number"),
"id_prot"=>array("label"=>"id_prot","type"=>"number"),
"pos_nr"=>array("label"=>"pos_nr","type"=>"number")
),
"cssClass"=>array("table"=>"table table-hover table-bordered")
));
?>
</body>
</html>