KoolReport's Forum

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

Pdf cloud export googlecharts are not to see #1937

Open Guenter Schuebert opened this topic on on Mar 1, 2021 - 1 comments

Guenter Schuebert commented on Mar 1, 2021

I have the following phenomenon: If I execute a normal PDF export, the google charts are correctly displayed in the PDF. However, if I use cloud export, the diagrams are not displayed. The site is operated with symfony. Please urgently for help!

Thank you very much for your support.

This is de Template.view.php

<html>
<body style="margin:0.5in 1in 0.5in 1in">

<div class="text-center">
    <h1>Download Report</h1>
</div>

<hr/>
<?php
use \koolreport\widgets\google\Table;
use \koolreport\widgets\google\ComboChart;

echo '<h2>Report Table</h2>';
Table::create(array(
    "dataStore"=>$this->dataStore('reports'),
    "columns"=>array(
        $this->params["data"][0][0][0]=>array(
            "type"=>"datetime",
        ),
        $this->params["data"][0][0][1]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][2]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][3]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][4]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][5]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][6]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][7]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][8]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][9]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][10]=>array(
            "type"=>"number",
        ),
        $this->params["data"][0][0][11]=>array(
            "type"=>"number",
        )
    ),

    "cssClass"=>array(
        "table"=>"table table-hover table-bordered"
    ),
    "max-width"=>"1000px",
    "width"=>"1000px",
));

echo '<h2>Report Chart</h2>';
ComboChart::create(array(
    "title"=>"Sale Report",
    "dataSource"=>$this->params["datachart"][datachartoutput],
    "columns"=>array(
        "Time",
        "gridac"=>array(
            "label"=>"gridac",
            "type"=>"number",
            "prefix"=>"$"
        ),
        "invacv"=>array(
            "label"=>"invacv",
            "type"=>"number",
            "prefix"=>"$"
        ),
        "invdcv"=>array(
            "label"=>"invdcv",
            "type"=>"number",
            "prefix"=>"$"
        ),
        "irradiation"=>array(
            "label"=>"irradiation",
            "type"=>"number",
            "chartType"=>"line",
        ),
    ),
    "options"=>array(
        "series"=> array(
            0=> array("targetAxisIndex"=> 0),
            3=> array("targetAxisIndex"=> 1),
        ),
        "vAxes"=>array(
            0=> array("title"=> 'KWH'),
            1=> array("title"=> 'Irradiation')
        ),
    ),
    "max-width"=>"1000px",
    "width"=>"1000px",

));

?>
</body>
</html>
```
David Winterburn commented on Mar 2, 2021

Hi Guenter,

Please try to change the "pageWaiting" option like this:

    $report->cloudExport("MyReportPDF")
    ->chromeHeadlessio($secretToken)
    ->settings([
        "pageWaiting" => "networkidle2", // try "load", "domcontentloaded", "networkidle0", "networkidle2"
    ])
    ->pdf($pdfOptions)
    ->toBrowser($pdfFilename)
    ;

Let us know if it solves the problem with chart loading. Thanks!

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

CloudExport