KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Cloud Export package - Failed Credential #752

Closed Thangavel opened this topic on on Mar 19, 2019 - 7 comments

Thangavel commented on Mar 19, 2019

I have generated the token key in the chromeheadless.io website after created the account.

When we generate the pdf as per example, following error occurs.

Request failed: {"error":"Failed credential!"}

Source Code:

<?php

require_once "../../koolreport/autoload.php";

require_once "MyReport.php";

$report = new MyReport;

$tokey_key = 'my-token';

$report->run()->cloudExport("MyReportPDF")->chromeHeadlessio($tokey_key)->pdf()->toBrowser("myreport.pdf");

David Winterburn commented on Mar 20, 2019

Hi Thangavel,

It seems our server has had some problem with connection. I've fixed it. Please try cloud export again. Thanks!

Thangavel commented on Mar 20, 2019

Thanks, Now I can able to download the report(PDF) but it does not load content, show error has failed to load a document.

View Content

This is my first export using Chromeheadless.io

Chromeheadless.io save your time and resources in exporting html, report to PDF.

Screenshot:

Please help us.

KoolReport commented on Mar 20, 2019

Is it possible that you post all of your code here, please remove your token id ( this is secret)

Thangavel commented on Mar 20, 2019

sure, I have tried an example which posted in the cloudexport package. Here source code and MyReportPDF code as follows

Source Code:

require_once "../../koolreport/autoload.php";

class MyReport extends \koolreport\KoolReport
{
    //Register cloud export service in your report
    use \koolreport\cloudexport\Exportable;
};
$report = new MyReport;
$report->run()->render();

$tokey_key = 'my-key';

$report->run()->cloudExport("MyReportPDF")->chromeHeadlessio($tokey_key)->pdf()->toBrowser("myreport.pdf");

MyReportPDF:

<html>
    <body>
        <h1>This is my first export using Chromeheadless.io</h1>
        <p>Chromeheadless.io save your time and resources in exporting html, report to PDF.</p>
    </body>
</html>

When we generate the report(pdf), able to download the pdf and it throws an error.

KoolReport commented on Mar 20, 2019

Please remove this line:

$report->run()->render();

The issue is that, this will render your report to browser and will interfere the function toBrowser() which output the content of pdf. This will cause the pdf corruption.

Thangavel commented on Mar 20, 2019

Thanks a lot. it's working

KoolReport commented on Mar 20, 2019

Great!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

CloudExport