I need help to get the export package to work. Here is my current code, based on an example:
MyReport.php
<?php
//Step 1: Load KoolReport
require_once ".../vendor/autoload.php";
//Step 2: Creating Report class
class MyReport extends \koolreport\KoolReport
{
use \koolreport\export\Exportable;
protected function settings()
{
return array(
"dataSources"=>array(
"data"=>array(
"class"=>'\koolreport\datasources\ArrayDataSource',
"dataFormat"=>"table",
"data"=>array(
array("name","age","income"),
array("John",26,50000),
array("Marry",29,60000),
array("Peter",34,100000),
array("Donald",28,80000),
)
)
)
);
}
protected function setup()
{
$this->src("data")
->pipe($this->dataStore("data"));
}
}
export.php
<?php
require_once "MyReport.php";
$report = new MyReport;
$report->export()->pdf()->toBrowser("myreport.pdf");
I've tried it also with:
->settings(array(
"useLocalTempFolder"=>true,
"phantomjs"=>".../vendor/koolreport/export/bin",
"resourceWaiting"=>2000,
))
All the packages are installed by the composer on our ubuntu server. I've also downloaded the phantomjs and put it into koolreport/export/bin.
It doesn't matter what I try, it is same result -> HTTP ERROR 500