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

Grid Export - OutOfMemoryException

4 Answers 144 Views
Grid
This is a migrated thread and some comments may be shown as answers.
NLV
Top achievements
Rank 1
NLV asked on 14 Jun 2010, 04:22 PM
Hello team

I've the following code for exporting a grid in various formats.

            if (ddlRBExportFormat.SelectedValue.Equals("MSExcel", StringComparison.InvariantCultureIgnoreCase)) 
            { 
                rgReportBuilder.MasterTableView.ExportToExcel(); 
            } 
            else if (ddlRBExportFormat.SelectedValue.Equals("MSWord", StringComparison.InvariantCultureIgnoreCase)) 
            { 
                rgReportBuilder.MasterTableView.ExportToWord(); 
            } 
            else if (ddlRBExportFormat.SelectedValue.Equals("PDF", StringComparison.InvariantCultureIgnoreCase)) 
            { 
                rgReportBuilder.MasterTableView.ExportToPdf(); 
            } 
            else if (ddlRBExportFormat.SelectedValue.Equals("CSV", StringComparison.InvariantCultureIgnoreCase)) 
            { 
                rgReportBuilder.MasterTableView.ExportToCSV(); 
            } 

I've huge number of records in the grid. When i do an export i get OutOfMemoryException. Is there a workaround to eliminate this error?

Thank you

Regards
NLV

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 14 Jun 2010, 05:06 PM
Hello NLV,

Please examine the following forum post:
Export to Excel limit

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Sony
Top achievements
Rank 1
answered on 01 Jun 2012, 12:18 PM
Hello,

  When I tried to export 100000 records from telerikradgrid to excel, it is showing system.outofmemoryexception as below.

  Is there any solution for this?

Expecting a response as early as possible.


Thanks,

Sony

Exception of type 'System.OutOfMemoryException' was thrown.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Web.UI.WebControls.WebControl.SaveViewState() +82
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +50
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Page.SaveAllState() +194
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2839
0
Sony
Top achievements
Rank 1
answered on 01 Jun 2012, 12:19 PM
Hello,

  When I tried to export 100000 records from telerikradgrid to excel, it is showing system.outofmemoryexception as below.

  Is there any solution for this?

Expecting a response as early as possible.


Thanks,

Sony

Exception of type 'System.OutOfMemoryException' was thrown.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Web.UI.WebControls.WebControl.SaveViewState() +82
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +50
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Control.SaveViewStateRecursive(ViewStateMode inheritedMode) +148
   System.Web.UI.Page.SaveAllState() +194
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2839
0
Jayesh Goyani
Top achievements
Rank 2
answered on 01 Jun 2012, 01:50 PM
Hello Sony,

Please check below link.
http://www.telerik.com/community/forums/aspnet-ajax/grid/export-to-excel-limit.aspx


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
NLV
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sony
Top achievements
Rank 1
Jayesh Goyani
Top achievements
Rank 2
Share this question
or