IronPython: Mark Rows, which are currently Filtered
When using the Data-On-Demand, there is a need, where you need to drive the on-demand data based on current selection. Below is helpful as you do not need to make your users Mark all Rows manually before proceeding to next steps.
#=================================================#
from Spotfire.Dxp.Data import *
#Setup your Source Table below where the Filtered rows need to
be captured
tblName="SalesAndMarketing"
FiltScheme = "FilteredRows"
MarkScheme = "Marking"
#Gets Source Table reference
dtRef=Document.Data.Tables[tblName]
#Gets the Current Filtered Rows as per the filtering schema
filtRows = Document.Data.Filterings[FiltScheme].GetSelection(dtRef).AsIndexSet()
#Marks the rows as per the filtered Rows
Document.Data.Markings[MarkScheme].SetSelection(RowSelection(filtRows),
dtRef)
#Do your table refreshes here
Document.Data.Tables["Table1 to Refresh"].refresh()
Document.Data.Tables["Table2 to Refresh"].refresh()
Document.Data.Tables["Table2 to Refresh"].refresh()
Comments
Post a Comment