KoolReport's Forum

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

Dashboard | Export to Excel not working #2935

Open Ilze Pabērza opened this topic on on Jan 10, 2023 - 3 comments

Ilze Pabērza commented on Jan 10, 2023

Dear team,

After updating Dashboard package 3.x to latest, export to Excel no working.

Message: Call to undefined method koolreport\core\DataStore::getRowGenerator() Line: 78 File: /var/www/koolreport_2/vendor/koolreport/excel/TableRowGroupsBuilder.php

Ilze Pabērza commented on Jan 11, 2023

Could you please help me with issue? Export to PDF is working correctly. Thank you in andvance!

When trying to get Excel:

[Widget] PaymentTable
Message: Call to undefined method koolreport\core\DataStore::getRowGenerator()
Line: 78
File: /var/www/koolreport_2/vendor/koolreport/excel/TableRowGroupsBuilder.php
 Expand

PaymentBoard.php ` <?php

namespace App\Dashboard;

use koolreport\dashboard\Client; use koolreport\dashboard\containers\Html; use koolreport\dashboard\containers\Panel; use koolreport\dashboard\Dashboard; use koolreport\dashboard\inputs\Button; use koolreport\dashboard\inputs\Dropdown;

class PaymentBoard extends Dashboard {

protected function content()
{
    return [
        Html::div([
            Dropdown::create("exporting")
            ->title("Export")
            ->align("right")
            ->items([
                Dropdown::menuItem()
                    ->text("Export to Excel")
                    ->icon("far fa-file-excel")
                    ->onClick(
                        Client::widget("PaymentTable")
                            ->exportToXLSX("Revenue 2022")
                    ),
                Dropdown::menuItem()
                    ->text("Export to PDF")
                    ->icon("fa fa-file-csv")
                    ->onClick(
                        Client::widget("PaymentTable")
                            ->exportToPDF("Revenue 2022")
                    ),
            ]),
        ])->class("text-right"),
        PaymentTable::create()
        ->xlsxExportable(true)
        ->pdfExportable(true)
    ];
}

} `

PaymentTable.php ` <?php

namespace App\Dashboard;

use \koolreport\dashboard\widgets\Table; use \koolreport\dashboard\fields\Number;

class PaymentTable extends Table {

protected function dataSource()
{
    return AutoMaker::table("orders")->limit(10);
}

protected function fields()
{
    return [
        Number::create("cards"),
    ];
}

} `

Sebastian Morales commented on Jan 11, 2023

Pls check your koolreport/core package to make sure that it's updated to at least version 5.6.0. A package version could be checked in its composer.json file.

Ilze Pabērza commented on Jan 11, 2023

For some reason composer didn't update core package. Problem solved after package reinstallation. Thank you!

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

Dashboard