Hello,
I know there are some issues related to this empty pdf issue, but no solution works for me yet. Also have tried the sample given in the documentation and still no luck.
Environment: Windows 10 XAMPP PHP 7
Below are my codes:
SalesReport.php
<?php
namespace App\Reports;
use koolreport\KoolReport;
use koolreport\export\Exportable;
use koolreport\laravel\Friendship;
class SalesReport extends KoolReport
{
use Friendship, Exportable;
function setup()
{
$this->src("mysql")
->query("SELECT * FROM items")
->pipe($this->dataStore("items"));
}
}
SalesReport.view.php
<?php
use \koolreport\widgets\koolphp\Table;
?>
<html>
<body>
<h1>It works</h1>
<?php
Table::create([
"dataSource" => $this->dataStore("items")
]);
?>
</body>
</html>
SalesReportController
<?php
namespace App\Http\Controllers\Report;
use App\Http\Controllers\Controller;
use App\Reports\SalesReport;
class SalesReportController extends Controller
{
public function index()
{
$report = new SalesReport();
$report->run()->export()->pdf(array(
"format" => "A4",
"orientation" => "portrait"
))->toBrowser("salesreport.pdf", true);
}
}
Thanks.