KoolReport's Forum

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

Release of Export package, exporting HTML/Javascript report to PDF and other formats. #13

Open Peter Williams opened this topic on on May 17, 2017 - 13 comments

Peter Williams commented on May 17, 2017

Dear all,

We have the release the Export package.

The package allows us to export our report to PDF and other formats such as JPG, PNG.

The sweet thing of this export package is that it supports latest version of HTML and CSS. Which means you are not worry about the compatibility of your HTML/CSS code in exporting to PDF as you do in other " HTML to PDF" libraries. Moreover, Javascript is supported. Any kind of client-based charts can be exported to PDF. This is feature that other "HTML to PDF" libraries can do.

The package support setting page size, page margin and repeated header/footer on page.

If you have any questions or comments, please leave them here.

Regards,

Peter

Glourise commented on May 24, 2017

I got it work from first start. Very easy to use. I really love it. Keep your momentum.

Hallie Gromek commented on Jul 11, 2017

I am not have any luck with the Export package,

I have tried to emulate the examples however this just seems to run before the report is rendered, or I can get the report to run and no PDF export options show.

tried this

automatically opens a pdf file with no information.

<?php
require_once "CustomersCategoriesProducts.php";
$CustomersCategoriesProducts = new CustomersCategoriesProducts;
$CustomersCategoriesProducts->run()->export()->pdf(array(
    "format"=>"A4",
    "orientation"=>"portrait"
))->toBrowser("myfile.pdf");

Any help is greatly appreciated. I have also tried the downloaded examples with the event.php however that also gave me no pdf options.

Any suggestions?

Peter Williams commented on Jul 11, 2017

Hi,

Could you please let me know the system information: OS, PHP Version?

Regards,

Peter

Hallie Gromek commented on Jul 11, 2017

Windows, php 5.6.30

KoolReport commented on Jul 13, 2017

Did you download the phantomjs.exe as indicated in the documentation of Export package?

Hallie Gromek commented on Jul 13, 2017

Yes and placed it koolreport/packages/export/bin here.

Hallie Gromek commented on Jul 18, 2017

Any suggestions? Have not been able to get it to work.

KoolReport commented on Jul 19, 2017

Hi Hallie,

I have tried to export with the same example, and it works. Could you please send us your code so that I can see what may cause problem.

Regards,

KoolPHP Inc

Hallie Gromek commented on Jul 19, 2017

Here is my index.php

<?php
require_once "myreport.php";
$myreport = new myreport;
$myreport->run();
//->export()->pdf(array(
 //   "format"=>"A4",
 //   "orientation"=>"portrait"
//))->SaveAs("myfile.pdf");
?>    
<html>
    <body>      
        <div>
            <?php $myreport->render();?>
        </div>
    </body>
</html>

Here is my export.php

<?php
require_once "myreport.php";
$myreport = new myreport;

$myreport->run()
->export('myreport')
->pdf(array(
    "format"=>"A4",
    "orientation"=>"portrait"
))
->SaveAs("myreport.pdf");
KoolReport commented on Jul 20, 2017

Could you please create a different view for export such as myreport_pdf.view.php. This view is basically the same with myreport.view.php but it contains all page tag such as <html> <head> <body>. Also in above code, you create the myreport.pdf and save it to local drive ( in the same folder with myreport.php), it does not push file to browser that why you see a blank page. You may use the toBrowser() function to push file to download. Also the function SaveAs() should be saveAs(). We follow the camel naming style.

Hallie Gromek commented on Jul 20, 2017

Can't get this to work still, following up with support.

Thank you

Marty commented on Jul 24, 2017

It seems the export package requires strict HTML syntax.

KoolReport commented on Jul 24, 2017

Example of combining inputs and export

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

Export