Jump to content
  • How to Export TablePlot data to a String in Spotfire® Using IronPython Scripting


    A Spotfire Table plot visualization can be exported to a memory stream and converted into a string with Python scripting for further manipulation.

    Introduction

    A Spotfire Table plot visualization can be exported to a memory stream and converted into a string with Python scripting for further manipulation.

    Code sample

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    import System
    from System.IO import StreamWriter,MemoryStream
    from System import Array
    from Spotfire.Dxp.Application.Visuals import TablePlot
    
    stream=MemoryStream()
    writer=StreamWriter(stream)
    #Export TablePlot data to memory stream
    tablePlot= tablePlot.As[TablePlot]()
    tablePlot.ExportText(writer)
    
    DataString = System.Text.Encoding.UTF8.GetString(stream.ToArray(),0, stream.Length)
    # DataString can be used for further manipulation
    print DataString
    
    # tablePlot - Parameter of type Visualization referencing the TablePlot to be exported.
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...