syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.55k stars 757 forks source link

Table with pagination does not export all data #2044

Open CGrandez opened 2 weeks ago

CGrandez commented 2 weeks ago

Use case

There is no possibility of exporting the entire table, it only exports the current view of the table.

Future<void> exportDataGridToExcel(GlobalKey<SfDataGridState> dataGridKey) async { final Workbook workbook = Workbook(); final Worksheet worksheet = workbook.worksheets[0]; dataGridKey.currentState!.exportToExcelWorksheet(worksheet, startColumnIndex: 1, startRowIndex: 3); final List<int> bytes = workbook.saveAsStream(); await helper.FileSaveHelper.saveAndLaunchFile(bytes, 'titulo.xlsx'); workbook.dispose(); }

Proposal

I propose to give the option to choose whether to export all the data or only the current view.

abineshPalanisamy commented 2 weeks ago

Hi @CGrandez ,

Please refer to the following Knowledge Base link for a deeper understanding of how to export all rows while having pagination in a Flutter DataTable. You can customize the provided code to suit your specific requirements.

KB link: Export rows

Regards, Abinesh P