Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Oh, it's because in the Dashboard's excel view file export_views/ExportViewBoardExcel.view.php
we don't include excel's Table widget. You can add it yourself to the excel view:
...
<div>
<?php
$ProductTable = $dashboard->widget("ProductTable");
\koolreport\excel\Table::create([
"dataSource" => $ProductTable->exportedData()
]);
?>
</div>
Hi, Can I used this method ?
...
Panel::create()->type("danger")->header("<b>Profit and Loss/Income Statement</b>")->sub([
Dropdown::create("exportOptions")
->title("<i class='far fa-file-pdf'></i> Export Options")
->items([
"Export PDF"=>MenuItem::create()
->onClick(
Client::showLoader().
Client::widget("ClosingPLStatementTable")->exportToPDF("PL Statement Dashboard", ["all" => true] )
),
"Export Xlsx"=>MenuItem::create()
->onClick(
Client::showLoader().
Client::widget("ClosingPLStatementTable")->exportToXLSX("All PL Statement Dashboard",["all"=>true])
),
])
->align("right")
->cssStyle("margin-bottom:15px;")
->cssClass("text-right"),
HTML::style("#ClosingPLStatementTable .table {white-space:nowrap;}"),
HTML::style("#ClosingPLStatementTable .pivot-column td{font-weight:bold}"),
HTML::style("#ClosingPLStatementTable .pivot-row{white-space: normal;}"),
ClosingPLStatementTable::create()->pdfExportable(true)->lazyLoading(true),
]),
....
I'm not sure what you meant but the menu and command for exporting the current dashboard to excel is:
Dropdown::menuItem()
->text("Dashboard to Excel")
->icon("far fa-file-excel")
->onClick(
Client::dashboard($this)
->exportToXLSX("Dashboard - Revenue 2022")
),
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo