Warning when upgrading to Spotfire 10

TIBCO has deprecated the JQueryUI Javascript library in the latest Spotfire 10.0 release

TIBCO Community pages show us how to use JQuery properly

extract csv data from visualization

#get list of filtered rows
dataTable = Document.ActiveDataTableReference
rows = Document.ActiveFilteringSelectionReference.GetSelection(dataTable).AsIndexSet()

#Script configuration
delim = ","
rowDelim = "\n"
docProperty = "myDocProperty"

#generate CSV
csv = ""
for column in dataTable.Columns:
   csv += column.Name + delim

csv += rowDelim

for r in rows:
   for column in dataTable.Columns:
      csv += column.RowValues.GetFormattedValue(r) + delim

#show results
print csv

1 comment:

Anonymous said...

How would you prompt the user to specify a file name or to create a file with a name given properties from the file (e.g. Report1_as_of_Date(DateTimeNow())_for_period_p$StartDate_to_p$EndDate.csv