KoolReport's Forum

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

Error Export pdf on Dashboard #2974

Open Daniel Cordeiro opened this topic on on Feb 7, 2023 - 1 comments

Daniel Cordeiro commented on Feb 7, 2023

When I'll try running export pdf nothing happen's...

App.php

namespace App;
use \koolreport\dashboard\languages\PTBR;   //Portuguese Brazil
use \koolreport\dashboard\Application;
use \koolreport\appstack\dashboard\AppStack;
use \koolreport\dashboard\User;
use App\Dashboard\Gerencial\GerencialBoard;
use \koolreport\dashboard\ExportHandler;
// use \koolreport\dashboard\export\ChromeHeadlessio;
use \koolreport\dashboard\export\LocalExport;

class App extends Application
{   
 protected function export()
    {
        return ExportHandler::create()
            ->storage(dirname(__DIR__) . "/storage/exports")
            ->pdfEngine(
                LocalExport::create()
                // ChromeHeadlessio::create()->token("My-Token")
            );
    }
   ...
}

dashboard.php:

<?php

namespace App\Dashboard\Gerencial;

use \koolreport\dashboard\Dashboard;
use \koolreport\dashboard\containers\Row;
use \koolreport\dashboard\inputs\Button;
use \koolreport\dashboard\Client;

// use ComprasAnoCard;
// use SavingAnoCard;

class GerencialBoard extends Dashboard
{
    protected function onCreate()
    {
        $this->default(true)
            ->title("Gerencial")
            ->hidden(false)
            ->icon("fa fa-home")
            ->badge(["NEW", "danger"])
            ->updateEffect("fade")
            ->pdfExportable(true);    //Allow exporting 
        
    }

    protected function content()
    {
        return [
            Row::create()->sub([
                Button::create()
                    ->text("Export dashboard to PDF")
                    ->onClick(
                        Client::dashboard($this)->exportToPDF()
                    ),
            ...
            ]);
        ];
    }
}

I try LocalExport and ChromeHeadlessio and nothing.

Daniel Cordeiro commented on Feb 7, 2023

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

Dashboard