Dear Support
We are creating Family Head Report in Codeigniter using KoolReport, Report has been created successfully but when we converting report in PDF we having following Errors "Object not found!"
Our Reports are under: D:\xampp\htdocs\dba\application\reports\census 1. FamilyHead.php 2. FamilyHead.view.php 3. FamilyHeadPdf.view.php 4. export.php
but when press PDF button on Report its show path like this "http://localhost/dba/export.php" its surprising for us why its find export.php at this path its should be looking for " D:\xampp\htdocs\dba\application\reports\census"
Kindly help us or make it one sample report under CodeIgniter enviroment with kool report to make PDF report
// Main Report FamilyHead // FamilyHead.php <?php
require APPPATH."/libraries/koolreport/autoload.php";
use \koolreport\KoolReport;
class FamilyHead extends \koolreport\KoolReport {
use \koolreport\codeigniter\Friendship;
use \koolreport\clients\Bootstrap;
use \koolreport\export\Exportable;
function settings()
{
//Get default connection from config.php
$config = include "config.php";
return array(
"dataSources"=>array(
"cences_db"=>$config["cences_db"]
)
);
return array(
"assets"=>array(
"path"=>"/../../../assets",
"url"=>"assets",
));
}
protected function setup()
{
//$this->src('cences_db')
$this->src('cences_db')
->query("SELECT HeadID,FirstName,Prov,CityDivision,MainArea,FormStatus
from headoffamily where id <20 ")
->pipe($this->dataStore("FamilyHead"));
}
}
// VIEW //FamilyHead.view.php
<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\ColumnChart;
?> <html>
<head>
<title>Student Information </title></title>
</head>
<body>
<h1>FamilyHead</h1>
<h3>List of Family Heads</h3>
<p class="lead">This example show how to export report to PDF</p>
<a href="export.php" class="btn btn-primary">Download PDF</a>
<?php
Table::create(array(
//ColumnChart::create(array(
"dataStore"=>$this->dataStore("FamilyHead"),
"class"=>array(
//"table"=>"table table-hover"
"table"=>"table-bordered table-striped table-hover"
)
));
?>
</body>
</html>
//PDF Report // FamilyHeadPdf.view.php
<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\ColumnChart;
?> <html>
<body style="margin:0.5in 1in 0.5in 1in">
<link rel="stylesheet" href="../../../assets/bs3/bootstrap.min.css" />
<link rel="stylesheet" href="../../../assets/bs3/bootstrap-theme.min.css" />
<div class="page-header" style="text-align:right"><i>Family Report</i></div>
<div class="page-footer" style="text-align:right">{pageNum}</div>
<div class="text-center">
<h1>Head of Family</h1>
<h4>This report show the no of Family Heads</h4>
</div>
<hr/>
<?php
Table::create(array(
//ColumnChart::create(array(
"dataStore"=>$this->dataStore("FamilyHead"),
"class"=>array(
//"table"=>"table table-hover"
"table"=>"table-bordered table-striped table-hover"
)
));
?>
</body>
</html>
//export.php
<?php require_once "FamilyHead.php"; $report = new FamilyHead;
$report->run() ->export('FamilyHeadPdf') ->pdf(array(
"format"=>"A4",
"orientation"=>"portrait",
//"zoom"=>2
)) ->toBrowser("Family_Head.pdf");