Hello all,
I've implemented an export all pages to Excel in my grid. My grid uses custom paging, template columns and is dynamically created on the server side.
I have a customer that tried to export all pages (80000 rows, not very big of a number) to Excel and his web server went to 100% CPU with over 1GB of RAM consumed for over 10 minutes. Then the CPU returned to normal but the memory stayed there for additional 20 minutes.Below please find the code snippet:
I searched all over the forums, saw that other people had this issue, but couldn't find a vaible solution.
Tried IgnorePaging flase and true. Tried Format of HTML and ExcelML. nothing.
The ExportToExcel() function simply kills the website.
Anyone has an idea?
Thanks,
T.
I've implemented an export all pages to Excel in my grid. My grid uses custom paging, template columns and is dynamically created on the server side.
I have a customer that tried to export all pages (80000 rows, not very big of a number) to Excel and his web server went to 100% CPU with over 1GB of RAM consumed for over 10 minutes. Then the CPU returned to normal but the memory stayed there for additional 20 minutes.Below please find the code snippet:
RadGrid GridReport = (RadGrid)GridPlaceHolder.FindControl("GridReport");
if (GridReport.MasterTableView.Columns.FindByUniqueNameSafe("ObjectName") != null)
{
GridReport.MasterTableView.Columns.FindByUniqueName("ObjectName").Visible = false;
GridReport.MasterTableView.Columns.FindByUniqueName("ObjectNameText").Visible = true;
}
//GridReport.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
GridReport.ExportSettings.Excel.Format = GridExcelExportFormat.Html;
GridReport.ExportSettings.IgnorePaging = true;
GridReport.ExportSettings.OpenInNewWindow = true;
GridReport.ExportSettings.ExportOnlyData = true;
if (cbExportAllPages.Checked == true)
GridReport.PageSize = GridReport.MasterTableView.VirtualItemCount;
GridReport.DataSource = reportResult(Session["sqlStr"].ToString());
GridReport.Rebind();
GridReport.MasterTableView.ExportToExcel();
I searched all over the forums, saw that other people had this issue, but couldn't find a vaible solution.
Tried IgnorePaging flase and true. Tried Format of HTML and ExcelML. nothing.
The ExportToExcel() function simply kills the website.
Anyone has an idea?
Thanks,
T.