Hi,,, today is my day of exporting... :-)
I try to export my report in PDF via Cloud package but the result looks terrible
I use the same view file but this is render result:
And this is pdf:
pdf_export.php
(the file which is open by main report)
require_once "../../koolreport/core/autoload.php";
require_once "stock_list_export.php";
$report = new stock_list_export;
$report->run()
->cloudExport("stock_list_export")
->chromeHeadlessio("token....")
->pdf()
->toBrowser("Stock_Inventory.pdf");
The stock_list_export.view.php
<?php
use koolreport\widgets\koolphp\Table;
$InventoryDate = $this->dataStore("stock_fact_names")->data()[0]['date'];
$stock = $this->dataStore("stock_fact_names")->data()[0]['stock'];
//$InventoryDate='';
//$stock='';
?>
<html lang="en">
<head>
<link rel="stylesheet" href="../../koolreport/bootstrap3/assets/core/css/bootstrap.min.css"/>
<link rel="stylesheet" href="../../koolreport/bootstrap3/assets/core/css/bootstrap-theme.min.css"/>
<meta charset="UTF-8">
<title>Inventory Stock Report</title>
</head>
<body>
<div class="container box-container">
<div class="text-center">
<h2>Inventory Stock Report</h2>
</div>
<hr/>
<hr/>
<div>
<b>Stock: </b> <?= $stock; ?><br><br>
<b>Inventory Date: </b> <?= $InventoryDate; ?><br>
</div>
<?php
Table::create(array(
"dataStore" => $this->dataStore('stock_fact_names'),
"grouping" => array(
"catName" => array(
"top" => "<td colspan=\"2\" <td class='top_group'><b>{catName} </b></td>",
)),
"columns" => array(
"id" => array(
"label" => "id",
"type" => "string",
),
"name" => array(
"label" => "Item Name",
),
"quantity" => array(
"label" => "Quantity",
"type" => "string",
),
"uom" => array(
"label" => "",
),
),
"cssClass" => array(
"table" => "table table-bordered table-striped"
)
));
?>
</div>
</body>
</html>