Hung Huynh Posted July 12, 2019 Share Posted July 12, 2019 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 More sharing options...
Shandilya Peddi Posted July 15, 2019 Share Posted July 15, 2019 You can try something like below on Spotfire Analyst, clr.AddReference("System.Windows.Forms") from System.Windows.Forms import OpenFileDialog, MessageBox OpenFile = OpenFileDialog() OpenFile.ShowDialog() filename = OpenFile.FileName MessageBox.Show("Selected file: " + filename) Link to comment Share on other sites More sharing options...
Hung Huynh Posted July 15, 2019 Author Share Posted July 15, 2019 Thank you for your help! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now