Filtering Schemes (current, all, add, set and other tricks)

from Spotfire.Dxp.Application.Filters import FilterPanel

#Show (or hide) the filter panel

Document.ActivePageReference.FilterPanel.Visible = True

#Get the current filtering scheme name
print Document.ActiveFilteringSelectionReference.Name

#List all the filtering schemes
for scheme in Document.FilteringSchemes: 
  print scheme.Name

# Add a new data filtering selection 
DataFilteringSelection dataFilteringSelection = Document.Data.Filterings.Add("My Filtering")

# A filtering scheme has now been implicitly added for the new data filtering selection.
FilteringScheme myFilteringScheme = document.FilteringSchemes[dataFilteringSelection]

#Let the active page use the new filtering scheme. 
document.ActivePageReference.FilterPanel.FilteringSchemeReference = myFilteringScheme

#Make sure that the filter panel shows the filtering scheme menu. 
document.FilteringSchemes.FilteringSchemeMenuVisible = true;

#get a reference to the current filtering scheme
currentFiltering = Document.FilteringSchemes[Document.ActiveFilteringSelectionReference]

Previous
Next Post »