Afsarr rr Posted March 10, 2020 Share Posted March 10, 2020 hi, i am using below script to generate csv from spotfire datafile but only file is being generate not the data. could you please help on this from Spotfire.Dxp.Data.Export import DataWriterTypeIdentifiers from System.IO import File writer = Document.Data.CreateDataWriter(DataWriterTypeIdentifiers.ExcelXlsDataWriter) table = Document.ActiveDataTableReference #OR pass the DataTable as parameter filtered = Document.ActiveFilteringSelectionReference.GetSelection(table).AsIndexSet() #OR pass the filter stream = File.OpenWrite("D:FILENAME.csv") names = [] for col in table.Columns: names.append(col.Name) writer.Write(stream, table, filtered, names) stream.Close() Link to comment Share on other sites More sharing options...
Tyger Guzman 2 Posted March 10, 2020 Share Posted March 10, 2020 Is the imported or external This script will only work with imported data. Link to comment Share on other sites More sharing options...
Afsarr rr Posted March 10, 2020 Author Share Posted March 10, 2020 it is external.Thanks for your reply. Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted March 10, 2020 Share Posted March 10, 2020 For external table, you can use below script to export "comma" separated file. You can create a table visualization containing external data then export data from that visualization. https://community.spotfire.com/wiki/how-export-tablecross-table-visualization-data-csv-file-using-tibco-spotfirer-using-ironpython If you just want to export "tab" separated file, use simple script like below: http://easyspotfire.blogspot.com/2014/04/export-table-visualization-to-file.html Spotfire 10.7 onwards, you can hide the page containing table visualization if you do not want to show it but still have export functionality in a button. Link to comment Share on other sites More sharing options...
Tyger Guzman 2 Posted March 10, 2020 Share Posted March 10, 2020 Good to know this works for external data (Only exports the data max 10,000 row from tableplot) I assumed since they were trying to export the data table that they wanted all records not just the sample 10,000 Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted March 11, 2020 Share Posted March 11, 2020 That is default limit for table viz when using external data. That limit can be changed from Preferences in order to show complete dataset in table viz. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now