Open CGrandez opened 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
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.