Category / Section
How to set custom file name for excel sheet while exporting?
1 min read
This KB illustrates that how to set custom file name for excel sheet while exporting.
Solution:
You can set the file name for excel at the service end. Refer to the following code example.
C#
public void ExportOptions(Stream stream) { olapGridHelper.ExportToExcel(DataManager, new StreamReader(stream).ReadToEnd(), "Valid Name.xls", HttpContext.Current.Response); }
VB
Public Sub ExportOptions(ByVal stream As Stream) olapGridHelper.ExportToExcel(DataManager, New StreamReader(stream).ReadToEnd(), "Valid Name.xls", HttpContext.Current.Response) End Sub