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

Export Excel 'System.OutOfMemoryException' issue with 160,000

3 Answers 128 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Dev asked on 12 Aug 2015, 07:37 PM

Hello Team,
I am using Radgrid, that is having more then 160,000 records with 46 columns. The version I am using is ASP.NET AJAX Q3 2013 SP2 (version 2013.3.1324). Excel version is 2013. Export to excel is not working and generate 'System.OutOfMemoryException". I believe Excel 2013 worksheet size hold close to a million rows. Is there any workaround ? See snippet of my code below. I created the grid dynamically

Can anyone help me out with this? Is there any limitation exporting excel or csv from Radgrid with this record size? 



     private void CreateDetailGrid()
            GridDetailResults.ID = "GridDetailResults";
            GridDetailResults.AutoGenerateColumns = false;
            GridDetailResults.GridLines = GridLines.Both;
            GridDetailResults.AllowSorting = GridDetailResults.AllowPaging = GridDetailResults.AllowSorting = true;
            GridDetailResults.AllowFilteringByColumn = true;
            GridDetailResults.Skin = "Default";
            GridDetailResults.HeaderStyle.Font.Underline = false;
            GridDetailResults.GroupingSettings.CaseSensitive = false;
            GridDetailResults.EnableLinqExpressions = false;
            GridDetailResults.Height = new Unit("400px");

            //Mastertableview settings
            GridDetailResults.MasterTableView.EnableNoRecordsTemplate = true;
            //GridDetailResults.MasterTableView.ShowHeader = true;
            GridDetailResults.MasterTableView.ShowHeadersWhenNoRecords = false;
            GridDetailResults.MasterTableView.CommandItemSettings.ShowExportToExcelButton = true;
            GridDetailResults.MasterTableView.CommandItemSettings.ShowExportToCsvButton = true;
            GridDetailResults.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
            GridDetailResults.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
            GridDetailResults.MasterTableView.CommandItemSettings.ShowRefreshButton = false;

            // paging style
            GridDetailResults.MasterTableView.PagerStyle.AlwaysVisible = true;
            GridDetailResults.MasterTableView.PagerStyle.PageSizeControlType = PagerDropDownControlType.RadDropDownList;

            // Export setting
            GridDetailResults.ExportSettings.HideStructureColumns = true;
            GridDetailResults.ExportSettings.UseItemStyles = true;
            GridDetailResults.ExportSettings.IgnorePaging = true;          
            GridDetailResults.ExportSettings.OpenInNewWindow = true;
            GridDetailResults.ExportSettings.Excel.Format = GridExcelExportFormat.Html;            
            GridDetailResults.ExportSettings.ExportOnlyData = true;

            GridDetailResults.NeedDataSource += GridDetailResults_OnNeedDataSource;

            GridDetailResults.ItemStyle.BackColor = Color.FromName("#DFDFDF");
            GridDetailResults.HeaderStyle.BackColor = Color.FromName("#FFFFFF");
            GridDetailResults.HeaderStyle.ForeColor = Color.FromName("#767676");
            GridDetailResults.AlternatingItemStyle.BackColor = Color.FromName("#FFFFFF");
            GridDetailResults.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
            GridDetailResults.FilterItemStyle.HorizontalAlign = HorizontalAlign.Left;

            GridDetailResults.ClientSettings.Scrolling.AllowScroll = true;
            GridDetailResults.ClientSettings.Scrolling.SaveScrollPosition = true;
            GridDetailResults.ClientSettings.Scrolling.UseStaticHeaders = true;
            GridDetailResults.ClientSettings.Scrolling.FrozenColumnsCount = 2;                 

            if (AllDimTable == null)
                AllDimTable = BusMethods.GetAllDimList();


3 Answers, 1 is accepted

Sort by
Jayesh Goyani
Top achievements
Rank 2
answered on 13 Aug 2015, 04:53 PM


Please check the below link.​


Jayesh Goyani

Top achievements
Rank 1
answered on 17 Aug 2015, 03:57 PM
What is the maximum record I can export using Radgrid then ? I can't go beyond 65,000 leave alone 160,000?
Maria Ilieva
Telerik team
answered on 19 Aug 2015, 07:41 AM

I would suggest you to see the forum post below for more information on this matter:

Maria Ilieva
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 Feedback Portal and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question