Jump to content
  • How to Add a Filter to a Filter Group in Spotfire® Using IronPython Scripting


    This article shows how to add a filter to a filter group using IronPython

    Introduction

    Below is a sample script on how to add a filter to a filter group 

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    import Spotfire.Dxp.Application.Filters as filters
    from Spotfire.Dxp.Application.Visuals import VisualContent
    from System import Guid
    
    page = Application.Document.ActivePageReference
    filterPanel = page.FilterPanel
    
    for tableGroup in filterPanel.TableGroups :
    	tableGroup.Expanded=True
    	if tableGroup.Name=="tableGroupName":
    		myFilterHandle=tableGroup.GetFilter("filterName")
    		myFilterHandle.Visible=False
    		myFilter=myFilterHandle.FilterReference
    		for filterGroup in tableGroup.SubGroups :
    			if filterGroup.Name=="filterGroupName":
    				filterGroup.Add(myFilter)
     

    References

     

    License:  TIBCO BSD-Style License

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


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...