Hi there,
I'm using RadGrid and its ExportToExcel feature. I tried both approach of using the built-in button by setting OnBiffExporting="ExportList" and :
and create my own:
Both are calling similar methods:
2. Custom version:
In both version the FileName property is set but only the custom version ends up with this name, the built-in one keeps spitting a RadGridExport.xls. Plus, in the custom version, all forbidden characters such as : / & < > are automatically replaced by _ which doesn't happen with the built-in feature.
Is this a bug or am I doing something wrong ?
Cheers,
I'm using RadGrid and its ExportToExcel feature. I tried both approach of using the built-in button by setting OnBiffExporting="ExportList" and :
<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="true" /><telerik:RadButton ID="rbtIGTExportToExcel" Width="150px" Text="Export To Excel" OnClick="btnExcel_Click" runat="server" Icon-PrimaryIconUrl="~/images/icons/sys-excel.png" />Both are calling similar methods:
- Built-in version:
protected void ExportList(object sender, EventArgs e){ RadGridListAllUser.ExportSettings.IgnorePaging = true; RadGridListAllUser.ExportSettings.OpenInNewWindow = true; RadGridListAllUser.ExportSettings.FileName = string.Format("{0} User List Export {1}", (string)Session["StudyName"], DateTime.Now.ToShortDateString()); RadGridListAllUser.MasterTableView.ExportToExcel();}2. Custom version:
protected void btnExcel_Click(object sender, EventArgs e){ rgIGTSummaryGrid.ExportSettings.IgnorePaging = true; rgIGTSummaryGrid.ExportSettings.OpenInNewWindow = true; rgIGTSummaryGrid.ExportSettings.FileName = string.Format("{0} IGT Export {1}", (string)Session["StudyName"], DateTime.Now.ToShortDateString()); rgIGTSummaryGrid.MasterTableView.ExportToExcel();}In both version the FileName property is set but only the custom version ends up with this name, the built-in one keeps spitting a RadGridExport.xls. Plus, in the custom version, all forbidden characters such as : / & < > are automatically replaced by _ which doesn't happen with the built-in feature.
Is this a bug or am I doing something wrong ?
Cheers,