Jump to content
  • How to change filter type in Spotfire® Using IronPython Scripting


    This article shows how to change filter type in Spotfire® Using IronPython Scripting

    Introduction

    Below is the IronPython script to change the filter type

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    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 filterhandle in tableGroup.FilterHandles:
    		if (filterhandle.FilterReference.TypeId == FilterTypeIdentifiers.ListBoxFilter):
    			#Set filter type to checkBoxFilter from ListBoxFilter
    			filterhandle.FilterReference.TypeId = FilterTypeIdentifiers.CheckBoxFilter
    			cbFilter = filterhandle.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
     

    References

    License:  TIBCO BSD-Style License

    Back to IronPython Scripting in TIBCO Spotfire Examples:  https://community.spotfire.com/s/article/IronPython-Scripting-in-Spotfire

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...