Hi all,
During implementation for Excel export function, I have found possible bug.
I am not using any fancy formatting or options, example what I have in my Controller is below:
(I am using codeigniter and running render directly, ignore that)
`
$export_status = isset($_GET['export']) ? $_GET['export'] : 'no';
if($export_status == 'yes') {
$vars['report'] = $report->run()->exportToExcel()->toBrowser("SumiranaProdaja.xlsx");
} else {
$vars['report'] = $report->run();
$this->fuel->admin->render('_admin/dnevni', $vars, Fuel_admin::DISPLAY_NO_ACTION); // render Admin section of UI
}
`
And my View is using DataGrid to display data. On top of that I have html coded buttons like below.
<!--Exports are wrong with click on button below -->
<div class="form-group text-center">
<button class="btn btn-success sivo"><a href="prodajaSumirano?export=yes" class="ico ico_export"> Export to Excel</a> </button>
</div>
<!--Fixed btn-->
<div class="form-group text-center" style="margin-left: 20px;">
<button type="submit" class="btn btn-success sivo" formaction="prodajaSumirano?export=yes">Export to Excel</button>
</div>
A: If I click on first button with "a href", export runs and exported file contains 2 spread sheets where first one has only column names and no data, but second spreadsheet is populated properly.
B: If I click on button with "formaction" it does run export process and exports all data in both spread sheets.
Conclusion - It is strange that first spreadsheet is never populated, but second, third, forth .... are populated properly.
Another thing, by using example below, I can't see Excel and PDF buttons. I was wondering why..?
(I am using DataGrid 5.0 Beta, if that makes any difference)
`
"dom" => 'Bfrtip',
"buttons" => [
'copy', 'csv', 'excel', 'pdf', 'print'
],