Kevin Nguyen 4 Posted July 21, 2019 Share Posted July 21, 2019 from Spotfire.Dxp.Application.Visuals import * Param1 = Document.Properties['Col1'] print Param1 def getDataTable(tableName): try: return Document.Data.Tables(tableName) except: raise ("Error - Cannot find data table: " + tableName) myDataTable = getDataTable("Merged Excel Files (4)") if Param1 == "Max(WellVolume)" : Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Max(WellVolume)for"]) if Param1 == "Min(WellVolumne)" : Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Min(WellVolume)for"]) Error: None warning: DeprecationWarning: raising a string exception is deprecated Traceback (most recent call last): File "Spotfire.Dxp.Application.ScriptSupport", line unknown, in ExecuteForDebugging File "", line 17, in File "", line 14, in getDataTable Error - Cannot find data table: Merged Excel Files (4) Error - Cannot find data table: Merged Excel Files (4) Link to comment Share on other sites More sharing options...
Rayees Wani Posted July 22, 2019 Share Posted July 22, 2019 I believe the way you are raising the exception here may not be a supported way. Check https://stackoverflow.com/questions/11497234/typeerrorexceptions-must-be... have you tried running without the try:except block. Link to comment Share on other sites More sharing options...
Kevin Nguyen 4 Posted July 22, 2019 Author Share Posted July 22, 2019 Hi Rayees, It worked without the try:except block. However, it's still not doing what I wanted to do. I'd have to figure out my next issue. Thanks 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