KoolReport's Forum

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

CloudExport package Beta version #614

Open KoolReport opened this topic on on Jan 25, 2019 - 6 comments

KoolReport commented on Jan 25, 2019

We are creating a new package called CloudExport which will use online service to export your report to PDF or other formats. We also implemented the export service called ChromeHeadless.io. Right now the service is in beta stage.

So to use the CloudExport package, you do:

1.Download the beta version from below link:

https://www.dropbox.com/s/mkvihselex6jaq9/cloudexport.zip?dl=0

unzip it to the koolreport/packages folder as you normally do for other packages.

2.Register an account in https://chromeheadless.io and create a token

3.Now in your report, you add:

class MyReport extends \koolreport\KoolReport
{
    use \koolreport\cloudexport\Exportable;
    ...
}

4.Export your report with following code:

$report = new MyReport;
$report->run()->cloudExport()
->chromeHeadlessio("your-token-key-here")
->pdf()
->toBrowser("myreport.pdf");

Since it is in beta version, we hope to receive your feedback on the packages as well as the cloud service for us to improve. We will update more documentation detail. Thank you very much!

Best regards,

<3 koolreport team

Glourise commented on Feb 8, 2019

I've tried and seems working well. Thump up! Please update your documentation.

Eugene commented on Feb 9, 2019

Hi, I tried it with my new report. Generally, it works but I have some questions/comments

  1. The pdf has no margin - the table fit exactly to the borders of the page. It is not so good for most cases and printers.

  2. The table lost the css backgrounds

  3. The report looks very similar to the report web page - with all controls, radio buttons etc.... It could be interesting but also it should possible to have the option to show the paraments in another way - I mean the template...

KoolReport commented on Feb 10, 2019

There are some options you can set insidepdf() function, for example:

->pdf(array(
    "margin"=>array(
        "top"=>"1in",
        "left"=>"1in",
        "bottom"=>"1in",
        "right"=>"1in",
    )
))

Here are list of properties.

Table has no background because of printing media css classes of bootstrap, here is a related topic. Actually the background was removed to save ink in printing.

Last issue, we should create a separate view file for PDF in which there is no form of inputs, only the results. Let say we create separated view named ReportPDF.view.php then we can do:

$report->run()->cloudExport("ReportPDF")
->chromeHeadlessio("your-token-key-here")
->pdf()
->toBrowser("myreport.pdf");
Eugene commented on Feb 10, 2019

I use the backgrounds for some columns using "cssStyle"=>"background-color:.... for these columns

So is the solution if i set specific class for that column (is it correct to do like this "cssStyle"=>"class='myclass'" ? and then add this class to the style section with my background settings?

jalila commented on Jun 16, 2020

Hello , In my app i'm using a different framework , I create $data=array( "dataSource"=>(new PdoDataSource($connection))->query(" myquerry"), ); then $table=Table::html($data); now i want to cloudExport the $table , how should i do ? Thank you

David Winterburn commented on Jun 17, 2020

Hi,

If you already had the html content used for export, just put it in a file called MyReportPDF.view.php, set up MyReport like this:

<?php
//MyReport.php
class Report extends \koolreport\KoolReport
{
    use \koolreport\cloudexport\Exportable;
}

and use this to cloud export:

//export.php
include "MyReport.php";
$report = new MyReport();
$report->run();
$report->cloudExport("MyReportPDF")
    ->chromeHeadlessio($secretToken)
    ->pdf(array(
        "format"=>"A4"
    ))
    ->toBrowser("MyReport.pdf")
    ;

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
announcement

None