Labels

Export a cross table visualization to a file


from System.IO import Path, File, StreamWriter
from Spotfire.Dxp.Application.Visuals import CrossTablePlot
 
#Temp file for storing the cross table data
tempFolder = Path.GetTempPath()
tempFilename = Path.GetTempFileName()

#Export CrossTable data to the temp file
writer = StreamWriter(tempFilename)
vTable.As[CrossTablePlot]().ExportText(writer)

print tempFilename

Input 
vTable (Visualization)

Not suitable for use over the web since the local file system is used.

7 comments:

  1. Hi,

    Thanks for the above Script. How can we export the same file in MS EXCEL

    ReplyDelete
  2. I am getting below Error, Please let me know how to resolve? How to define vTable.
    Traceback (most recent call last):
    File "Spotfire.Dxp.Application.ScriptSupport", line unknown, in ExecuteForDebugging
    File "", line 10, in
    NameError: name 'vTable' is not defined

    ReplyDelete
    Replies
    1. You need to define 'vTable' as a script parm. In the ipython window select 'Add...' and select a visualization. Name it 'vTable'.

      Delete
    2. You need to define 'vTable' as a script parm. In the ipython window select 'Add...' and select a visualization. Name it 'vTable'.

      Delete
  3. Thanks to the authors of the post for such great information. I love your blog post, I have something to share here.
    wordpress
    blogspot
    youtube
    បាការ៉ាត់អនឡាញ

    ReplyDelete
  4. Your articles are consistently excellent. You're doing a fantastic job. This will be really beneficial to many others. By the way, I'm a gamer, and I'd like to recommend a shader pack for Minecraft to you. You can get the BSL Shaders ​pack here, and I'm sure you'll enjoy it.

    ReplyDelete