Thank you. I currently have the following in my settings and setup. Notice that I am using mySQL for much of the data in the report. I use the same datasource over and over again, and then saveTo() different variables. Honestly, I have no idea if this is valid since I am "flying blind". Can I have more than one dataSources array in settings (one for mySQL, and one for my $_SESSION['result'])? And how about setup? Can I just paste your code above below my existing setup?
public function settings()
{
return array(
"assets" => array(
"path" => "/app/assets/koolreport_assets",
"url" => "assets",
),
"dataSources" => array(
"substantiator" => array(
"connectionString" => "mysql:host=mysql;dbname=mysql_databases",
'host' => 'mysql',
'username' => 'admin',
'password' => 'xxx',
'dbname' => 'substantiator',
'charset' => 'utf8',
'class' => "\koolreport\datasources\MySQLDataSource"
),
)
);
}
function setup()
{
$campaign=$_SESSION['campaign'];
$email=$_SESSION['userid'];
$this->src('substantiator')
->query("SELECT bus_comp FROM business_components WHERE campaign='$campaign' AND email='$email'")
->pipe(new ColumnRename(array(
"bus_comp"=>"Business Component")))
->pipe($this->dataStore("business_components"))
->saveTo($BC);
$this->src('substantiator')
->query("SELECT project FROM project WHERE campaign='$campaign' AND email='$email'")
->pipe($this->dataStore("project"))
->saveTo($PR);
$this->src('substantiator')
->query("SELECT cost_center_number, cost_center_name FROM cost_center WHERE campaign='$campaign' AND email='$email'")
->pipe(new ColumnRename(array(
"cost_center_number"=>"number","cost_center_name"=>"name")))
->pipe($this->dataStore("cost_center"))
->saveTo($CC);
$this->src('substantiator')
->query("SELECT description FROM campaigns2 WHERE company_division='$campaign' AND email='$email'")
->pipe(new ColumnRename(array(
"description"=>"company")))
->pipe($this->dataStore("campaigns2"))
->saveTo($CA);
$this->src('substantiator')
->query("SELECT employee,employee_title, w2_wages FROM employees WHERE campaign='$campaign'")
// ->pipe(new ColumnRename(array(
// "description"=>"company")))
->pipe($this->dataStore("employees"))
->saveTo($EM);
$this->src('substantiator')
->query("SELECT URL FROM images WHERE campaign='$campaign' AND email='$email'")
// ->pipe(new ColumnRename(array(
// "description"=>"company")))
->pipe($this->dataStore("images"))
->saveTo($IM);
}