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

Exception of System.OutOfMemoryException type to try export data in a excel file

1 Answer 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andres
Top achievements
Rank 1
Andres asked on 16 Dec 2008, 09:24 PM
Greetings for everybody

I have had problems trying to export data to excel format from a grid with 34 columns, the data volume is 30,000 records aprox, when the query exceds 20,000 records, I get the next error:

Se produjo una excepci├│n de tipo 'System.OutOfMemoryException'.   en System.Collections.Specialized.HybridDictionary.Add(Object key, Object value)
   en System.Web.UI.StateBag.Add(String key, Object value)
   en System.Web.UI.WebControls.TableCell.set_Text(String value)
   en Telerik.Web.UI.GridTableCell..ctor(Boolean useNbsp)
   en Telerik.Web.UI.GridItem.CreateCellObject()
   en Telerik.Web.UI.GridItem.Initialize(GridColumn[] columns)
   en Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)
   en Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode)
   en Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
   en Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls)
   en Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
   en Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
   en System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
   en System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
   en System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   en System.Web.UI.WebControls.DataBoundControl.PerformSelect()
   en Telerik.Web.UI.GridTableView.PerformSelect()
   en System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   en Telerik.Web.UI.GridTableView.DataBind()
   en Telerik.Web.UI.RadGrid.DataBind()
   en Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason)
   en Telerik.Web.UI.RadGrid.RebindForExport()
   en Telerik.Web.UI.Grid.Export.TableViewExporter.PrepareForExport()
   en Telerik.Web.UI.Grid.Export.TableViewExporter.page_PreRender(Object sender, EventArgs e)
   en System.EventHandler.Invoke(Object sender, EventArgs e)
   en System.Web.UI.Control.OnPreRender(EventArgs e)
   en System.Web.UI.Control.PreRenderRecursiveInternal()
   en System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Here are the exporting options:

                        Grid1.ExportSettings.ExportOnlyData = true;
                        Grid1.ExportSettings.IgnorePaging = true;
                        Grid1.ExportSettings.OpenInNewWindow = true;
                        Grid1.MasterTableView.ExportToExcel();

 could someone help me with some ideas?

Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Dec 2008, 01:33 PM
Hi Andres,

I have found the following forum link which discusses a similar issue. Go through it and see what telerik had suggested.
System.OutOfMemoryException

Regards
Princy
Tags
Grid
Asked by
Andres
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or