Exporting Large Number of Items Throws rowIndex Out of Bound Exception

2 posts, 0 answers
  1. Ahmed
    Ahmed avatar
    16 posts
    Member since:
    May 2014

    Posted 06 May Link to this post

    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

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    281 posts

    Posted 10 May Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top