Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Sorry for my late reply. It is possible, you can add any extra data to the end or at beginning of data. The solution is you use another array data source to pipe an empty row to the data pipeline.
Here is an example:
class MyReport extends \koolreport\KoolReport
{
function settings()
{
return array(
"dataSources"=>array(
"mainSource"=>array(
"connectionString"=>"mysql:host=localhost;dbname=automaker",
"username"=>"root",
"password"=>"",
'charset' => 'utf8',
),
"dummySource"=>array(
"class"=>'\koolreport\datasources\ArrayDataSource',
"data"=>array(
array(
"customerName"=>"",
"customerId"=>"",
)
)
)
)
);
}
function setup()
{
$this->src("dummySource")
->pipe(new ColumnMeta(array()))
->saveTo($pipeline);
$this->src("mainSource")
->select("select customerName,customerId from customers")
->pipe($pipeline)
->pipe($this->dataStore("customers"));
}
}
The effect is that you pipe an empty row from dummySource
to $pipeline
then the mainSource
continue to pipe real data to $pipeline. As a result, your will have data table which has empty row at first.
Hope that helps.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo