We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to set the current cube name as an Excel file name while exporting?

Platform: jQuery |
Control: ejPivotClient

This KB illustrates that how to set the current cube name as an Excel file name while exporting.


Current OLAP Cube name can be set as a file name to the exported excel document by using the following code example.


public void ExportOptions(Stream stream)
 PivotGrid olapGridHelper = new PivotGrid();
 OlapDataManager DataManager = new OlapDataManager(connectionString);
 string args = new StreamReader(stream).ReadToEnd();
 string olapReport = args.Split(new string[] { "&layout=" },                  StringSplitOptions.None)[0].Remove(0, 14).Replace("%2F", "/").Replace("%2B", "+").Replace("%3D", "=");        DataManager.SetCurrentReport(OLAPUTILS.Utils.DeserializeOlapReport(olapReport));
string Name = DataManager.CurrentCubeName + ".xls";
string FileName = Name.Replace(" ", "");
olapGridHelper.ExportToExcel(DataManager, args, FileName, HttpContext.Current.Response);


Public Sub ExportOptions(stream As Stream)
 Dim olapGridHelper As New PivotGrid()
 Dim DataManager As New OlapDataManager(connectionString)
 Dim args As String = New StreamReader(stream).ReadToEnd()
 Dim olapReport As String = args.Split(New String() {"&layout="}, StringSplitOptions.None)(0).Remove(0, 14).Replace("%2F", "/").Replace("%2B", "+").Replace("%3D", "=")
 Dim Name As String = DataManager.CurrentCubeName + ".xls"
 Dim FileName As String = Name.Replace(" ", "")
 olapGridHelper.ExportToExcel(DataManager, args, FileName, HttpContext.Current.Response)
 End Sub


You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile