This is a migrated thread and some comments may be shown as answers.

Exporting Large Number of Items Throws rowIndex Out of Bound Exception

1 Answer 6 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 06 May 2016, 08:55 AM

Hi,

I have a gridview contains 2+ Millions rows and around 5 columns, I want to export the gridview as Excel or PDF document. When call export, I get rowIndex out of bound exception.

Here is the way I used to export as Excel

exportGridView.ExportToXlsx(stream, new GridViewDocumentExportOptions
                                                                                             {
                                                                                                 AutoFitColumnsWidth = true,
                                                                                                 ExportDefaultStyles = true,
                                                                                             });

 

=============================

and this is the way I export as PDF

exportGridView.ExportToPdf(stream, new GridViewPdfExportOptions
                                                                                            {
                                                                                                AutoFitColumnsWidth = true,
                                                                                                ExportDefaultStyles = true,
                                                                                            });

 

Best regards,

Ahmed

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 10 May 2016, 10:16 AM
Hello Ahmed,

As all data that is about to be exported is saved in memory, there is a certain limitation of the total amount of items that you can export. I suggest you check the Reporting tools for scenarios where a huge amount of data needs to be exported. You can also consider some custom logic to export the grid in parts and in separate files.

Regards,
Stefan Nenchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or