pxlrbt/filament-excel

I've empty file after export

rajo-vilo opened this issue · 1 comments

Hi @pxlrbt , this is my config :

  • Laravel : 10.18
  • Filament : 2.17
  • Filament Excel : 1.1
  • Spatie/Simple-excel : 3.2.0

With simple export in bulk action , the export work, but when i add custom closure, the exported file is empty.

Examples on same Resource Filament:

This work :

ExportBulkAction::make()->label('Exporter'),

This not work :

ExportBulkAction::make()->exports([
    ExcelExport::make()->withFilename(date('Y-m-d') . ' - export'),
])

Please, how can I fix this issues ?

Also, how to customize export to add total row on the bottom excel file export ? Or, how customize data export like custom table filament ?

Thanks,

pxlrbt commented

This not work :

You didn't specify any columns. What do you expect to be exported? Either use ->fromTable() or similar methods or specify ->withColumns(). Please read the docs on this.

Also, how to customize export to add total row on the bottom excel file export ? Or, how customize data export like custom table filament ?

You'll probably need a custom export class and cannot make use of the niceties of the plugin then. Check the last section in the docs on how to use custom Export classes.