Jump to content
We've recently updated our Privacy Statement, available here. ×

Iron python script to get datatable from spotfire to csv

Afsarr rr

Recommended Posts


i am using below script to generate csv from spotfire datafile but only file is being generate not the data. could you please help on this

from Spotfire.Dxp.Data.Export import DataWriterTypeIdentifiers

from System.IO import File

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

table = Document.ActiveDataTableReference #OR pass the DataTable as parameter

filtered = Document.ActiveFilteringSelectionReference.GetSelection(table).AsIndexSet() #OR pass the filter

stream = File.OpenWrite("D:FILENAME.csv")

names = []

for col in table.Columns:


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


Link to comment
Share on other sites

For external table, you can use below script to export "comma" separated file. You can create a table visualization containing external data then export data from that visualization.


If you just want to export "tab" separated file, use simple script like below:


Spotfire 10.7 onwards, you can hide the page containing table visualization if you do not want to show it but still have export functionality in a button.

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...