The TIBCO Platform is a real-time, composable data platform that will bring together an evolving set of your TIBCO solutions - and it's available now!
A chart showing the TIBCO Platform vision
Jump to content
Forums
Ask questions and gain insight from discussions

Recommended Posts

Posted

https://community.tibco.com/wiki/how-export-tablecross-table-visualization-data-sbdf-file-spotfire-library-using-tibco-spotfirer

Was able to do what I needed after reading through some other users comments in the Chatter feed of this page linked above. Following section of code will copy a CrossTable and save it to a Data Table, overwriting upon execution.

from System.IO import *

from Spotfire.Dxp.Application.Visuals import VisualContent

from System import Array,Guid,String,Object

from Spotfire.Dxp.Data.Import import *

from Spotfire.Dxp.Framework.Library import LibraryManager, LibraryItemRetrievalOption, LibraryItemType, LibraryItem

 

vc=Visuals.As[VisualContent]() #Visuals = Script parameter for Table/Cross Table visualization

memStream = MemoryStream();

sWriter = StreamWriter(memStream);

#Exporting the data to Memory Stream

vc.ExportText(sWriter); #exports data in tab separated text

sReader = StreamReader(memStream);

memStream.Seek(0, SeekOrigin.Begin);

 

textDataSource = TextFileDataSource(memStream);

tables = Document.Data.Tables["FakeTable"] # Create dummy exportdata datatable and have the rows in visualization be exported to that table

tables.ReplaceData(textDataSource)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...