Thanks David. Sorry I am so easily confused! I have three files that deal with koolreport.
First I have a function in the controller that calls it:
public function report_generator2()
{
$report= new MyReport;
$report->run()->render();
}
Then I have two files in the assets directory, MyReport.php and MyReport.view.php. MyReport has: 2 functions, settings and setup. Here is setup:
function setup()
{
$this->src('substantiator')
->query("SELECT bus_comp FROM business_components WHERE campaign='Apple' AND email='richb201@gmail.com'")
->pipe(new ColumnRename(array(
"bus_comp"=>"Business Component")))
->pipe($this->dataStore("business_components"));
}
MyReport.view.php has lots of HTML, but the important thing (from the Koolreport perspective) is
<?php
Table::create(array(
"dataStore"=>$this->dataStore("business_components"),
"class"=>array(
"table"=>"table table-hover"
)
));
This part appears in the Business Components part of the report. I also have other "sections" such as the Employees section and the Cost Centers section. Each of these sections will have different reports based on different tables and will have different graphs.
So how I read your response above, in the MyReport.view.php I will have
<h2>Business Components</h2>
<?php
Table::create(array(
"BusinessComponents"=>$this->dataStore("business_components"),
"class"=>array(
"table"=>"table table-hover"
)
));
<h2>Employees</h2>
<?php
Table::create(array(
"Employees"=>$this->dataStore("employees"),
"class"=>array(
"table"=>"table table-hover"
)
));
How should I modify the MyReport.php to have a different Query and pipe? Right now they are ONLY for business components. Do I just need to change the "DataStore" string to "BusinessComponentsStore" and create another one in MyReport.php that has ->pipe($this->dataStore("BusinessComponentsStore")); ?
There seems to be two moving parts here, MyReport.php and MyReport.view.php and I am not sure how they interact.