TousifAhamed Nadaf Posted March 20, 2017 Share Posted March 20, 2017 Hi All, I have written Iron Python script to export table data into excel(*.xlsx) format but the same script is not functional from web player. Did any one tried this. Is there any work around to make it functional. Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted March 20, 2017 Share Posted March 20, 2017 Hello Tousif, Below is an Sample code that should work on both Client and Web Player. When you execute the script on WebPlayer the file is exported to the Spotfire Export folder under Web Player server . =============================== from Spotfire.Dxp.Data.Export import DataWriterTypeIdentifiers from System.IO import File, Directory from System.Collections.Generic import List table = Document.ActiveDataTableReference writer = Document.Data.CreateDataWriter(DataWriterTypeIdentifiers.ExcelXlsDataWriter) allRows = Document.Data.AllRows.GetSelection(table).AsIndexSet() # directory if not Directory.Exists("C:\Spotfire_Export"): Directory.CreateDirectory("C:\Spotfire_Export") names = [] # columns stream = File.OpenWrite("C:\Spotfire_Export\Filename.xls") allColumnNames = List[str]() for column in table.Columns: allColumnNames.Add(column.Name) writer.Write(stream, table, allRows, allColumnNames) stream.Close() stream.Dispose() ============================= Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted March 21, 2017 Share Posted March 21, 2017 Hello Tousif, Iron python scripts are executed on Web Player server and thus the files are exported here. If you want to share it with the user then you can export the files to an Network shared drive and share the link with the user. We cannot replicate the Out of box export functionality with Iron Python, you can create an C# extension for that Link to comment Share on other sites More sharing options...
TousifAhamed Nadaf Posted March 22, 2017 Author Share Posted March 22, 2017 Thank you Shandilya for sharing this information. Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted March 22, 2017 Share Posted March 22, 2017 Hello Tousif, You can visit http://spotfire.tibco.com/about-us/partners to get more information. Link to comment Share on other sites More sharing options...
Sanandh C k Posted November 1, 2017 Share Posted November 1, 2017 Hi Shandilya, How can we save this exported file into webplyer downloads folder using same button click Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted November 1, 2017 Share Posted November 1, 2017 Hello Sanandh, You can provide the file path something as below, C:Users<username>Downloads or C:UsersAdministratorDownloads Link to comment Share on other sites More sharing options...
Sanandh C k Posted November 1, 2017 Share Posted November 1, 2017 Hi Shandilya, Thanks for your response. Actualy the requirement is if I am exporting data from one machine (this is not a nodemanger machine) , I want to save excel file into this machine. Now it is saving nodemngr machine. Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted November 1, 2017 Share Posted November 1, 2017 Hello Sanandh, It is not possible to download the files locally. The workaround would be to use a network shared path so that you can access the files easily Link to comment Share on other sites More sharing options...
Grazia Palmisano Posted May 4, 2020 Share Posted May 4, 2020 Hi, have you find a solution to the issue Thank you 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