Jump to content
  • Loop Through Pages and Visualization in Spotfire® Using IronPython Scripting


    Back to main IronPython scripting page

    Introduction

    This example loops through all the Pages and Visualizations. It could be useful if you look for a page with a certain name or a certain Visualisation on a specific page. Or if you want to modify all visualizations of a certain type.

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    #Writing output to a Document Property that could be shown in a html/text area in Spotfire
    Document.Properties["scriptOutput"]=''
    #loop through all pages and visualizations, and print the Type of each visualization
    for p in Document.Pages:
       print (p.Title)
       Document.Properties["scriptOutput"]+=p.Title+'\n'
       for v in p.Visuals: 
          print ('-' + v.Title + '('+ v.TypeId.Name +')')
          Document.Properties["scriptOutput"]+='-'+v.Title+'('+v.TypeId.Name+')\n'
     

    References


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...