Jan 5, 2016

Change Data Table Using Python Script in Spotfire

Change Data Table


##### Change Data table

from Spotfire.Dxp.Application.Visuals import VisualContent

tbl = currentTableVisualization.As[VisualContent]()
newtbl = Document.Data.Tables.Item['Data']
tbl.Data.DataTableReference=newtbl
tbl.AutoConfigure()
tbl.ApplyUserPreferences()

Nov 2, 2015

Assign marked values to Porperty control and redirect to new page

from Spotfire.Dxp.Data import DataValueCursor
myLatCursor = DataValueCursor.CreateFormatted(Document.Data.Tables["IL_GetStatus"].Columns["Project_ID"])
markedRows = Document.Data.Markings["StatusReportMarking"].GetSelection(Document.Data.Tables["IL_GetStatus"]).AsIndexSet()
for row in Document.Data.Tables["IL_GetStatus"].GetRows(markedRows, myLatCursor):
 Document.Properties['JobID'] = myLatCursor.CurrentValue
 Document.ActivePageReference = Document.Pages[2]

Jun 15, 2015

Toggle the filter panel on\off

if (Document.ActivePageReference.FilterPanel.Visible == False):
   Document.ActivePageReference.FilterPanel.Visible = True
else:
   Document.ActivePageReference.FilterPanel.Visible = False

Toggle the details-on-demand panel on\off

if (Document.ActivePageReference.DetailsOnDemandPanel.Visible == False):
   Document.ActivePageReference.DetailsOnDemandPanel.Visible = True
else:
   Document.ActivePageReference.DetailsOnDemandPanel.Visible = False