pxlrbt / filament-excel

Excel Export for Filament Admin Resources
MIT License
323 stars 68 forks source link

When I enqueue a file to be exported, the file is empty #130

Closed man0l closed 8 months ago

man0l commented 8 months ago

Hi,

I have this code:

->bulkActions([ ExportBulkAction::make()->exports([ ExcelExport::make()->queue() ]) ]) ->headerActions([ ExportAction::make()->exports([ ExcelExport::make()->queue() ]) ])

it doesn't seems to be working. On the other hand, when I use the default export it exports.

I've spotted that the both notifications for enqueued export file and for ready for download file are being popped up at the same time. It seems like it is missing some configuration.

Could you help me out to sesolve the issue?

pxlrbt commented 8 months ago

Hey @man0l, you didn't specify any columns that you want to export. You either need to pass them via ->withColumns() or use ->fromTable()/->fromForm()/->fromModel() to autodetect them.

I've spotted that the both notifications for enqueued export file and for ready for download file are being popped up at the same time. It seems like it is missing some configuration.

Maybe that's because the export was super fast? Or do you use sync as the queue driver?

devfaysal commented 8 months ago

Similar issue here

ExportBulkAction::make() works fine But when I add file name its exporting empty excel sheet

ExportBulkAction::make()->exports([
    ExcelExport::make()->withFilename('zone-report-' . date('d-m-Y-H-i-s'))
])
pxlrbt commented 8 months ago

@devfaysal Did you read the previous message?!

devfaysal commented 8 months ago

Ah, Sorry, I Missed the earlier comment.

It works fine now after doing this

ExportBulkAction::make()->exports([
    ExcelExport::make()->withFilename('zone-report-' . date('d-m-Y-H-i-s'))->fromTable()
])