Andreas Karagiannis Posted May 14, 2020 Share Posted May 14, 2020 I am trying to use Ironpython to have a button export my table to excel with only the S/N and comments Columns. When I enter a value into the input box I want to export the selected row and comments into excel. this is the code I used from Spotfire.Dxp.Data.Export import DataWriterTypeIdentifiers from System.IO import File, Directory from System.Collections.Generic import List from Spotfire.Dxp.Data import * from Spotfire.Dxp.Application.Visuals import * DataTable = Document.ActiveDataTableReference Rows = Document.ActiveFilteringSelectionReference.GetSelection(DataTable).AsIndexSet() writer = Document.Data.CreateDataWriter(DataWriterTypeIdentifiers.ExcelXlsDataWriter) stream = File.OpenWrite("C:\Users\akaragiaDesktop\Comments\SHOP_ORDER (Illuminator).xls") Cols = ["SFC", "Comments"] # pulls in SFC Column writer.Write(stream, DataTable, Rows, Cols) stream.Close() Link to comment Share on other sites More sharing options...
Rayees Wani Posted May 15, 2020 Share Posted May 15, 2020 If you are looking for Marked Rows then this "ActiveFilteringSelectionReference" should be "ActiveMarkingSelectionReference" The same has be advised here: https://community.spotfire.com/questions/using-ironpython-export-markedd-da... 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