Laravel-Backpack / community-forum

A workspace to discuss improvement and feature ideas, before they're actually implemented.
28 stars 0 forks source link

[Feature] Export operation #197

Open tabacitu opened 2 years ago

tabacitu commented 2 years ago

Discussed in https://github.com/Laravel-Backpack/CRUD/discussions/2667

Originally posted by **tabacitu** April 13, 2020 Instead of using DataTable's magic to export rows, we should create an Export operation. That way: - we could even customize how it's done, add different export formats, etc; - it would fix the problem of having to see all entries that are exported (known limitation of the DataTables export when using AJAX); The way I see it: - the operation adds a single "Export" button to the bottom stack; - click the button and it opens a modal; in that modal, you can - choose which columns to show in the export; - (maybe) reorder the columns in the export; - choose the export format (XLS, CSV, PDF); - choose to export: - All rows (124.141 entries) - Filtered rows (45.133 entries) - Currently visible rows (25 rows) - Currently selected rows (5 rows) - click "Download" and you get the file you want; the file itself is generated using [PHP generators](https://www.php.net/manual/en/language.generators.syntax.php), so that you can export even millions of rows;
mamarmite commented 2 years ago

Hi @tabacitu, I've started this feature as if it were in the backpack namespace : https://github.com/mamarmite/export-operation Is it ok ? Anyhow feel free to ask to change it until it's finished or anything.

For now the basic setup for the operation as a package is setup.

The feature implemented :

Notes I've got time to implement the excel export.

I didn't dig and testing into https://github.com/yajra/laravel-datatables-export (it need livewire and I wouldn't have it to be requested in the current project I'm implementing this.

I will push my progress to the repo linked earlier. Feel free to comments /

tabacitu commented 1 year ago

@jorgetwgroup , @pxpm and @maurohmartinez - please have a meeting about this, for Pedro to brief you guys on its status. We have it, but... it's not perfect. Reach a conclusion on how to move forward and let's do this 💪

@jorgetwgroup has the details on the deadline and everything, so let's follow his lead.

Take it away @jorgetwgroup 🙏