Product: TIBCO Spotfire®
How to change the filter type via IronPython script.
The following script details how to change the filter type using the API.
##########################################################################
from Spotfire.Dxp.Application.Visuals import VisualContent.
from Spotfire.Dxp.Application import Filters as filters
from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers
# Get the filter panel on the current active page
filterPanel = Document.ActivePageReference.FilterPanel
# Perform filtering action
for tableGroup in filterPanel.TableGroups:
for fh in tableGroup.FilterHandles:
if fh.Visible:
if (fh.FilterReference.TypeId == FilterTypeIdentifiers.ListBoxFilter):
#Set filter type to checkBoxFilter from ListBoxFilter
filter.TypeId = FilterTypeIdentifiers.CheckBoxFilter
cbFilter = fh.FilterReference.As[filters.CheckBoxFilter]()
#cbFilter is your handle to new check box filter converted from List box filter
#Other filterTypeIdentifiers
##CheckBoxFilter
##CheckBoxHierarchyFilter
##ItemFilter
##ListBoxFilter
##RadioButtonFilter
##RangeFilter
##TextFilter
############################################################################
Comments
0 comments
Article is closed for comments.