mireles
8 days agoNew Contributor II
How to save the outputs of ExportCubeViewGridsToExcelFile() to a .xlsx file?
I've tried to implement this function as per the Business Rules Editor snippet:
Dim objByte() As Byte() = BRApi.CubeViews.Process.ExportCubeViewGridsToExcelFile(si, custSubstVarsForAllCubeViews, cubeViewNamesAndVars)
However, I've had a few problems with this, the main one being that I've been unable to save whatever it returns to an Excel file. Here's what I've tried:
Dim fileName As String = "test.xlsx"
Dim filePath As String = $"Documents/Users/{StringHelper.RemoveSystemCharacters(si.UserName,False,False)}"
Dim XFfileDataInfo As New XFFileInfo(FileSystemLocation.ApplicationDatabase,fileName,filePath)
Dim XFfileData As New XFFile(XFfileDataInfo, String.Empty, objByte)
BRApi.FileSystem.InsertOrUpdateFile(si, XFfileData)
Whenever I run this code the output file is an XML. How do I save this to a .xlsx file?
Which download button are you using?
Button 1 downloads in 'OneStream format' i.e. xml. Button 2 downloads in file format eg xlsx