Jump to content

How do I prompt the user on Spotfire to create .csv and .xlsx excel file


Hung Huynh

Recommended Posts

Hi, I am trying to prompt the user on Spotfire to create an excel file to "My Documents".

 

from Spotfire.Dxp.Data.Export import DataWriterTypeIdentifiers

from System.IO import File

 

writer = Document.Data.CreateDataWriter(DataWriterTypeIdentifiers.ExcelXlsxDataWriter)

filtering = Document.ActiveFilteringSelectionReference.GetSelection(table).AsIndexSet()

 

#create an excel file with its path of file and filename

 

stream = File.OpenWrite(LOCATION OF EXCEL FILE) #open excel file to be read

names = []

 

for col in table.Columns:

names.append(col.Name)

 

writer.Write(stream, table, filtering, names)

stream.Close()

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...