Jump to content
  • Working with Table Cells in Spotfire® using IronPython


    Code sample to work around with TableCells in a Table Visualization

    Introduction

    This sample provides the code to work around with TableCells in a Table Visualization

    Code

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application.Visuals import *
    from Spotfire.Dxp.Data.DataValueProperties import ContentType
    from Spotfire.Dxp.Data import *
    
    #dt is a script parameter referencing the table visualization
    
    tp= dt.As[TablePlot]()
    layout = tp.CreateLayout()
    cells = layout.GetCells()
    
    #Loop through all the table cells
    for c in cells:
     #TableCellType can be a Header or Value
     if c.CellType == TableCellType.Value:
      #Retrieve the cell value
      print c.DataValue.Value
      #If column is Link renderer retrive the link
      print c.Link
      
    #Get a specific range of rows
    #firstRowIndex,firstColumnIndex,lastRowIndex,lastColumnIndex
    c=CellRange(2, 0, 3, tp.TableColumns.Count - 1)
    cell = layout.GetCells(c)
    for c1 in cell:
     print c1.DataValue.Value
     print c1.Tooltip
    
    if(layout != None):
    	layout.Dispose()
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...