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

4 posts, 0 answers
  1. Dev
    Dev avatar
    2 posts
    Member since:
    Aug 2015

    Posted 12 Aug 2015 Link to this post

    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();


  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 13 Aug 2015 in reply to Dev Link to this post


    Please check the below link.



    Jayesh Goyani

  3. Dev
    Dev avatar
    2 posts
    Member since:
    Aug 2015

    Posted 17 Aug 2015 in reply to Jayesh Goyani Link to this post

    What is the maximum record I can export using Radgrid then ? I can't go beyond 65,000 leave alone 160,000?
  4. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 19 Aug 2015 Link to this post


    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
Back to Top