Hung Huynh Posted July 11, 2019 Share Posted July 11, 2019 I am trying to create a save as dialog popup. The script prompts for the user to input a file name and file type however I keep getting this error before it stops running: Traceback (most recent call last): File "", line 21, in AttributeError: 'HtmlTextArea' object has no attribute 'ExportText' import System from System.IO import FileStream, FileMode from Spotfire.Dxp.Application.Visuals import TablePlot from Spotfire.Dxp.Data.Export import DataWriterTypeIdentifiers import clr clr.AddReference("System.Windows.Forms") from System.Windows.Forms import SaveFileDialog SaveFile = SaveFileDialog() SaveFile.Filter = "Excel Workbook (*.xlsx)|*.xlsx" #file type saving to SaveFile.ShowDialog() saveFilename = SaveFile.FileName print "saveFilename=", saveFilename from Spotfire.Dxp.Application.Visuals import VisualContent,TablePlotColumnSortMode from Spotfire.Dxp.Data.Export import DataWriterTypeIdentifiers from System.IO import File, StreamWriter writer = Document.Data.CreateDataWriter(DataWriterTypeIdentifiers.ExcelXlsDataWriter) stream = StreamWriter(saveFilename) te = summaryCrossTable.As[VisualContent]() te.ExportText(stream) # the error occurs here Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted July 11, 2019 Share Posted July 11, 2019 In this code what is "summaryCrossTable" referring to Is it a CrossTable Visualization or an Text Area, can you verify te = summaryCrossTable.As[VisualContent]()Based on the error "SummaryCrossTable" might be referring to an Text Area within the analysis Link to comment Share on other sites More sharing options...
Hung Huynh Posted July 11, 2019 Author Share Posted July 11, 2019 I figured it out! I selected the wrong information from the summaryCrossTable. Thank you for your help. 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