Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
I tried with datatables built in pdf export. It does'nt support arabic fonts. Now I have been trying with koolreport. But 'Could not execute phantomjs error' is coming. Have been going through your forum dealing with this error. Nothing seems to help in my case. I am using windows 10, xampp and laravel
Normally, "Could not execute phantomjs" happens when phantomjs does not have permission to run. In some system, it requires to do full installation ( not just copy like we do, although the suggestion from phantomjs is that we only need to copy the execution file). That's our experience from helping other customers to make phantomjs work. Alternative solution is that you may try our cloudexport package. We create the CloudExport as backup for those find installation of phantomjs impossible ( like in shared host). You may try to see how.
Presently I am trying to run this simple html :
<html>
<head>
hello
</head>
<body>
This is my first export using Chromeheadless.io
<p>Chromeheadless.io save your time and resources in exporting html, report to PDF.</p>
</body>
</html>
--and I am getting a pdf with just 'hello' from <head>section. file size is 7 bytes
3)I am using toBrowser() method.
Are you using Export package or CloudExport?
If you have your output like this, it works, let try:
<html>
<head>
</head>
<body>
This is my first export using Chromeheadless.io
<p>Chromeheadless.io save your time and resources in exporting html, report to PDF.</p>
</body>
</html>
Putting text into head
is not correct, so just remove it. Does it work?
CsvReport.php
<?php
namespace App\Reports;
class CsvReport extends \koolreport\KoolReport
{
use \koolreport\laravel\Friendship;
use \koolreport\export\Exportable;
public function settings()
{
return array(
"dataSources" => array(
"mysql" => array(
'host' => 'localhost',
'username' => 'myTask360',
'password' => '123',
'dbname' => 'mytask360',
'charset' => 'utf8',
'class' => "\koolreport\datasources\MySQLDataSource",
'modes' => ['IGNORE_SPACE',
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'ERROR_FOR_DIVISION_BY_ZERO',
'NO_AUTO_CREATE_USER',
'NO_ENGINE_SUBSTITUTION'
],
),
"assets"=>array(
"path"=>public_path(),
"url"=>""
)
)
);
}
function setup()
{
$this->src('mysql')
->query("SELECT supervision_name,project_name,task_name,owner_name,assignee_name,status_name,creation_date,due_Date,completion_percent,task_duration_wd,end_in_wd,delay_wd,missing_due_date FROM v_tasks_delayed")
->pipe($this->dataStore('user_details'));
}
}
CSVReportController.php
<?php
namespace App\Http\Controllers;
use App\Reports\CsvReport;
use \koolreport\export\Exportable;
class CsvReportController extends Controller
{
public function __construct()
{
$this->middleware("guest");
}
public function index()
{
$report = new CsvReport;
$report->run()->export('CsvReportPDF')
->settings(array(
"useLocalTempFolder"=>true,
"phantomjs"=>"C:/xampp/htdocs/laravelKoolDelayed/vendor/koolphp/koolreport/packages/export/bin/phantomjs",
"resourceWaiting"=>2000,
))
->pdf(array(
"format"=>"A4",
"orientation"=>"portrait",
//"zoom"=>2,
"margin"=>"1in"
))
->toBrowser("orders.pdf");
}
}
Oh! I've looked at your code and I see this:
"phantomjs"=>"C:/xampp/htdocs/laravelKoolDelayed/vendor/koolphp/koolreport/packages/export/bin/phantomjs",
The file should have "exe" extension in windows. Let try:
"phantomjs"=>"C:/xampp/htdocs/laravelKoolDelayed/vendor/koolphp/koolreport/packages/export/bin/phantomjs.exe",
and by the way, you may not need to set this as Export package will try to locate the file in bin.
when I enter that comment
phantomjs --version
Suggestion [3,General]: The command phantomjs was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\phantomjs". See "get-help about_Command_Precedence" for more details. PS C:\xampp\htdocs\delayedReportTrial\vendor\koolphp\koolreport\packages\export\bin>
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo