Hi Expert,
I have a data grid that contains huge data (above 1 Lakh). If I download a large record, It will take a long time. So My app is crashed. Given below is my code. final List<int> bytes = workbook.saveAsStream(); This line is taking time. is there any way to reduce the time? Pls, help me.
Future<void> _exportDataGridToExcel() async {
final Workbook workbook = _key.currentState!
.exportToExcelWorkbook(rows: gridDataSource.entireDataGridRows);
final List<int> bytes = workbook.saveAsStream();
workbook.dispose();
await helper.saveAndLaunchFile(bytes, 'DataGrid.xlsx');
}
Thanks in advance
Hi Sreesherine,
To ensure a more effective investigation of this issue, please provide the following information:
1. Specify the platform where you are encountering the problem (e.g., Android, Windows, Mac, or another platform).
2. Additionally, please include details about the versions you are using:
- Flutter version
- DataGrid export version
This information will greatly assist us in diagnosing and resolving the issue you are facing.
Regards,
Tamilarasan
Hi Tamilarasan,
Thanks for your reply, Pls, see the below information.
Framework • revision f468f3366c (3 months ago) • 2023-07-12 15:19:05 -0700
Engine • revision cdbeda788a
Tools • Dart 3.0.6 • DevTools 2.23.1)
syncfusion_flutter_xlsio: ^22.2.12
If I export the data from an 8Gb RAM machine, It exports faster but If I do the export in 4GB RAM, It takes time. This is the only thing found so far.
Sreesherine,
We have conducted an analysis and determined that exporting 4 columns and 1 lakh rows consumes approximately 500 MB of memory and takes approximately 3 seconds on a machine with 16GB of RAM. These resource usage figures are considered reasonable for handling such a large dataset.
It's important to note that Excel exports, by nature, consume both RAM and processing time in proportion to the data size. Therefore, if you anticipate exporting larger datasets in your application, we recommend considering an increase in RAM capacity. Failing to do so may result in performance issues, including potential crashes, particularly on machines with limited RAM when handling extensive Excel data exports.
Hi Tamil,
Thank you for providing me with the analysis results regarding the Excel exports. I appreciate the detailed information.
If I have any further questions or require additional assistance, I'll reach out. Once again, thank you for your response and assistance.
Sreesherine,
Thanks for the update. Please get back to us if
you require further assistance. As always, we will gladly assist you.