How to reduce the time of huge data Excel export?

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


5 Replies

TP Tamilarasan Paranthaman Syncfusion Team October 4, 2023 09:13 AM UTC

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



SK sreesherine krishty October 4, 2023 10:18 AM UTC

Hi  Tamilarasan,

Thanks for your reply, Pls, see the below information.

  1. Platform is Windows
  2. Flutter Version (Flutter 3.10.6 • channel stable • https://github.com/flutter/flutter.git
  3. 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)

     3.  syncfusion_flutter_datagrid_export: ^22.2.12

         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.



TP Tamilarasan Paranthaman Syncfusion Team October 6, 2023 12:19 PM UTC

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.




SK sreesherine krishty October 10, 2023 04:25 AM UTC

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.



TP Tamilarasan Paranthaman Syncfusion Team October 10, 2023 10:46 AM UTC

Sreesherine,


Thanks for the update. Please get back to us if you require further assistance. As always, we will gladly assist you.


Loader.
Up arrow icon