Thank you so much for the previous reply !!!!! ... I had the set up exactly as you said however, I get this error always, see below. I use it in a codeigniter application.
An uncaught Exception was encountered
Type: Exception
Message: Query Error >> [Unknown column 'RelationOrderID' in 'where clause'] >> SELECT * FROM Orders WHERE RelationOrderID = :RelationOrderID
Filename: D:\www\xxxx\application\libraries\koolreport\src\datasources\PdoDataSource.php
This is my full setup, could you please help me 1 more time?
This is my Controller:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require APPPATH."/reports/MyReport.php";
class Xxxx extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->helper('url');
$this->load->library('ion_auth');
$this->load->library('grocery_CRUD');
}
public function _xxxx_output($output = null)
{
//$this->load->view('welcome.php',(array)$output);
}
public function index()
{
echo 'string';$this->_xxxx_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array()));
$report = new MyReport(array("RelationOrderID"=>"Just The Bare Bones"));
$report->run()->render();
}
}
This is MyReport:
//MyReport.php
require APPPATH."/libraries/koolreport/autoload.php";
class MyReport extends \koolreport\KoolReport
{
use \koolreport\inputs\Bindable;
use \koolreport\inputs\POSTBinding;
use \koolreport\clients\Bootstrap;
function settings()
{
return array(
"assets"=>array(
"path"=>"../../assets",
"url"=>"assets",
),
"dataSources"=>array(
"automaker"=>array(
"connectionString"=>"mysql:host=xxx;dbname=xxxx",
"username"=>"xxx",
"password"=>"xxx",
"charset"=>"utf8"
)
)
);
}
function setup()
{
// $this->src('automaker')
// ->query("Select OrderID, OrderRelationID from Orders WHERE OrderRelationID=:OrderRelationID")
// ->params(array(":OrderRelationID"=>$this->params["OrderRelationID"]))
// ->pipe($this->dataStore("Orders"));
$this->src("automaker")->query("
SELECT * FROM Orders
WHERE
RelationOrderID = :RelationOrderID
")
->params(array(
":RelationOrderID"=>$this->params["RelationOrderID"]
))
->pipe($this->dataStore("Orders"));
}
}
This is MyReport.view
//MyReport.view.php
use \koolreport\inputs\DateRangePicker;
use \koolreport\widgets\koolphp\Table;
use \koolreport\inputs\Select;
?>
<html>
<head>
<title>MyReport</title></title>
</head>
<body>
<h1>MyReport</h1>
<h3>List all orders</h3>
<?php
Table::create(array(
"dataStore"=>$this->dataStore("Orders"),
"class"=>array(
"table"=>"table table-hover"
)
));
?>
</body>
</html>