KoolReport's Forum

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

404 Not Found - nginx/1.14.0 (Ubuntu) #879

Closed Sarra opened this topic on on May 18, 2019 - 4 comments

Sarra commented on May 18, 2019

It has been 2 days that this error appears when trying to export to pdf the SalesByCustomer Example with cloudExport. Before, it worked perfectly. Here is the code :

//index.php
require_once "../koolreport/autoload.php";
require_once "SalesByCustomer.php";
$salesbycustomer = new SalesByCustomer;
$salesbycustomer->run()
    ->cloudExport("SalesByCustomer")
    ->chromeHeadlessio("myToken")
    ->pdf()
    ->toBrowser("myreport.pdf", true);

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

//Specify some data processes that will be used to process
use \koolreport\processes\Group;
use \koolreport\processes\Sort;
use \koolreport\processes\Limit;

//Define the class
class SalesByCustomer extends \koolreport\KoolReport
{
    use \koolreport\clients\Bootstrap;
    use \koolreport\cloudexport\Exportable;
    protected function settings()
    {
        //Define the "sales" data source which is the orders.csv 
        return array(
            "dataSources"=>array(
                "sales"=>array(
                    "class"=>'\koolreport\datasources\CSVDataSource',
                    "filePath"=>"orders.csv",
                ),        
            )
        );
    }
  
    protected function setup()
    {
        //Select the data source then pipe data through various process
        //until it reach the end which is the dataStore named "sales_by_customer".
        $this->src('sales')
        ->pipe(new Group(array(
            "by"=>"customerName",
            "sum"=>"dollar_sales"
        )))
        ->pipe(new Sort(array(
            "dollar_sales"=>"desc"
        )))
        ->pipe(new Limit(array(10)))
        ->pipe($this->dataStore('sales_by_customer'));
    }
}

<?php
//SalesByCustomer.view.php 
    use \koolreport\widgets\koolphp\Table;
    use \koolreport\widgets\google\BarChart;
?>

<div class="report-content">
    <div class="text-center">
        <h1>Sales By Customer</h1>
        <p class="lead">This report shows top 10 sales by customer</p>
    </div>

    <?php
    BarChart::create(array(
        "dataStore"=>$this->dataStore('sales_by_customer'),
        "width"=>"100%",
        "height"=>"500px",
        "columns"=>array(
            "customerName"=>array(
                "label"=>"Customer"
            ),
            "dollar_sales"=>array(
                "type"=>"number",
                "label"=>"Amount",
                "prefix"=>"$",
                "emphasis"=>true
            )
        ),
        "options"=>array(
            "title"=>"Sales By Customer",
        )
    ));
    ?>
    <?php
    Table::create(array(
        "dataStore"=>$this->dataStore('sales_by_customer'),
            "columns"=>array(
                "customerName"=>array(
                    "label"=>"Customer"
                ),
                "dollar_sales"=>array(
                    "type"=>"number",
                    "label"=>"Amount",
                    "prefix"=>"$",
                )
            ),
        "cssClass"=>array(
            "table"=>"table table-hover table-bordered"
        )
    ));
    ?>
</div>

Giulia Fois commented on May 20, 2019

I have the same problem!

Sarra commented on May 20, 2019

Someone could help us please !

David Winterburn commented on May 24, 2019

Hi Sarra and Giulia,

We are terribly sorry for the exporting service disruption. Some days ago we had some server's load balancing configuration change which caused this error.

We have managed to finally fix the issue and the service should work correctly now. Please test it and let us know if it works for you. Thanks!

Sarra commented on May 24, 2019

Hi David, Thank you so much, it works.

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