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

Export to Excel displays

1 Answer 11 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Miguel
Top achievements
Rank 1
Miguel asked on 14 Nov 2014, 07:18 PM
I am using Telerik RadGrid (v4.0.30319) and I have a dataset with about 171 columns and approximately 63K records. When I export these records to excel 2010, I get an error "Exception of type 'System.OutOfMemoryException' was thrown." How can I go about exporting such a large file to excel?  

My code is :  

if (e.Button.Text == "Export")
{
    if (SessionVars.ReportID > 0)
    {
        Report rpt = new Report(SessionVars.ReportID);
        foreach (GridColumn c in GridReportData.MasterTableView.Columns)
            c.HeaderStyle.Width = Unit.Empty;
 
        GridReportData.ExportSettings.HideStructureColumns = true;
        GridReportData.ExportSettings.FileName = Gridrpt.Report_Name;
 
        try
        {
            GridReportData.MasterTableView.ExportToExcel();
        }
        catch (System.OutOfMemoryException ex)
        {
            RadWindowManager.RadAlert("Report failed to export.",null, null, "Export Error", "ErrorAlert");
        }
 
        RadAjaxManager1.EnableAJAX = true;
    }
}

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 19 Nov 2014, 11:28 AM
Hello Asim,

A colleague of mine has already answered the support ticket which you have opened so I would recommend you to continue the conversation with him and close this forum thread.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Miguel
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or