Jump to content
  • How to Mark Rows based on Document Property Value in Spotfire® Using IronPython Scripting


    This article provides a sample IronPython script reference on how to mark rows based on a value in column that is specified in a Document Property

    Introduction

    This article provides a sample IronPython script reference on how to mark rows based on a value in column that is specified in a Document Property

    Code Sample

    # Copyright © 2019. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Data import *
    
    selectedValue=Document.Properties["propertyName"]
    
    # Create a cursor to refer a column which will have the values
    table=Document.Data.Tables["tableName"]
    cursor = DataValueCursor.CreateFormatted(table.Columns["columnName"])
    
    rowCount = table.RowCount
    
    # Empty indexset
    rowsToMark = IndexSet(rowCount,False)
    for row in Document.ActiveDataTableReference.GetRows(cursor):
       rowIndex = row.Index
       if cursor.CurrentValue == selectedValue:
           rowsToMark.AddIndex(rowIndex)
           
    Document.ActiveMarkingSelectionReference.SetSelection(RowSelection(rowsToMark),table)
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...