Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
To export, you need to include
use \koolreport\cloudexport\Exportable;
in your SalesByProduct.php
And then in the index.php, instead of render by
$report->run()->render();
you do:
$report->run()->cloudExport()
->chromeHeadlessio("key")
->pdf()
->toBrowser("sales_by_product.pdf");
im sorry for my mistake, now ady change it and another error happen
Warning: file_get_contents(http://localhost/jinxiPhp/final project/koolreport/src/clients/core/KoolReport.js): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\xampp\htdocs\jinxiPhp\final project\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
Warning: file_get_contents(http://localhost/jinxiPhp/final project/koolreport/src/clients/bootstrap/css/bootstrap-theme.min.css): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\xampp\htdocs\jinxiPhp\final project\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
Warning: file_get_contents(http://localhost/jinxiPhp/final project/koolreport/src/clients/bootstrap/css/bootstrap.min.css): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\xampp\htdocs\jinxiPhp\final project\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
Warning: file_get_contents(http://localhost/jinxiPhp/final%20project/index.php/css): failed to open stream: HTTP request failed! in C:\xampp\htdocs\jinxiPhp\final project\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\jinxiPhp\final project\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
hi i try to remove the space, but now get the same error, but seem like shorter a bit
Warning: file_get_contents(http://localhost/jinxiPhp/finalproject/index3.php/css): failed to open stream: HTTP request failed! in C:\xampp\htdocs\jinxiPhp\finalproject\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\jinxiPhp\finalproject\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
hi sorry, could you do a checking for me? this is my index3.php
<?php
require_once "SalesByProduct.php";
$salesByProduct = new SalesByProduct;
$salesByProduct->run()
->cloudExport("SalesByProduct")
->chromeHeadlessio("my key")
->pdf()
->toBrowser("sales_by_product.pdf");
?>
SalesByProduct.php
<?php
require_once "koolreport/autoload.php";
use \koolreport\processes\Group;
use \koolreport\processes\Sort;
use \koolreport\processes\Limit;
class SalesByProduct extends \koolreport\KoolReport
{
use \koolreport\cloudexport\Exportable;
use \koolreport\clients\Bootstrap;
public function settings()
{
return array(
"dataSources"=>array(
"sales"=>array(
"connectionString"=>"mysql:host=localhost;dbname=finalproject",
"username"=>"root",
"password"=>"",
"charset"=>"utf8"
)
)
);
}
public function setup()
{
$this->src('sales')
->query("SELECT product_name,total_sales FROM dbproduct")
->pipe(new Group(array(
"by"=>"product_name",
"sum"=>"total_sales"
)))
->pipe(new Sort(array(
"total_sales"=>"desc"
)))
->pipe(new Limit(array(10)))
->pipe($this->dataStore('Top_Selling_Product'));
}
}
this is SalesByProduct.view.php
<?php
use \koolreport\widgets\koolphp\Table;
use \koolreport\widgets\google\BarChart;
?>
<div class="text-center">
<h1>Sales Report</h1>
<h4>This report shows top 10 sales product</h4>
</div>
<hr/>
<?php
BarChart::create(array(
"dataStore"=>$this->dataStore('Top_Selling_Product'),
"width"=>"100%",
"height"=>"500px",
"columns"=>array(
"product_name"=>array(
"label"=>"Product Name"
),
"total_sales"=>array(
"type"=>"number",
"label"=>"Sales Amount",
"prefix"=>"$",
)
),
"options"=>array(
"title"=>"Top 10 Selling Product"
)
));
?>
<?php
Table::create(array(
"dataStore"=>$this->dataStore('Top_Selling_Product'),
"columns"=>array(
"product_name"=>array(
"label"=>"Product Name"
),
"total_sales"=>array(
"type"=>"number",
"label"=>"Sales Amount",
"prefix"=>"$",
)
),
"cssClass"=>array(
"table"=>"table table-hover table-bordered"
)
));
?>
Big thanks for your time!
hi the result is as below
Warning: file_get_contents(http://localhost/jinxiPhp/finalproject/index3.php/css/css): failed to open stream: HTTP request failed! in C:\xampp\htdocs\jinxiPhp\finalproject\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\jinxiPhp\finalproject\koolreport\packages\cloudexport\vendor\chromeheadlessio\php-client\src\Exporter.php on line 163
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo