Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from Spotfire.Dxp.Application.Filters import *
- from Spotfire.Dxp.Application.Visuals import VisualContent
- from System import Guid
- selectedColor = Document.Properties["LineFilter"]
- #Get the active page and filterPanel
- page = Application.Document.ActivePageReference
- filterPanel = page.FilterPanel
- #Get reference for FilteringScheme used for your filter
- for fs in Document.FilteringSchemes:
- if fs.FilteringSelectionReference.Name == "Filtering scheme":
- filterPanel.FilteringSchemeReference = fs
- #This example uses a listbox filter, you may use any.
- filterPanel.InteractiveSearchPattern = "Line"
- for filter in filterPanel.FiltersMatchingSearchPattern:
- if filter.FilterReference.Name == "Line":
- lbFilter = filter.FilterReference.As[ListBoxFilter]()
- #This will print selected values in List box filter
- #print lbFilter.SelectedValues
- #To set list box filter, Make sure that the data type of the values match the column type. In this example, "1,", "2", "5" are the actual column values to be selected in the filter.
- _array = []
- _array.append(selectedColor)
- if selectedColor is None :
- lbFilter.IncludeAllValues=True
- else :
- lbFilter.IncludeAllValues=False
- lbFilter.SetSelection(_array)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement