Kevin Nguyen 4 Posted July 23, 2019 Share Posted July 23, 2019 The script below doesn't do what I want it to do Please help! Please note that Vis1 is the script parameter. Thanks for your help. ------------------------------------------------------------------------------ from Spotfire.Dxp.Application.Visuals import * from Spotfire.Dxp.Data import * from Spotfire.Dxp.Application.Visuals import TablePlot Param1 = Document.Properties['Col1'] #print Param1 def getDataTable(tableName): # try: # return Document.Data.Tables(tableName) # except: # raise ("Error - Cannot find data table: " + tableName) #here use your data table name myDataTable = getDataTable("Merged Excel Files (4)") # myDataTable = Vis1.As[TablePlot]().Data.DataTableReference if Param1 == "Max(WellVolume) for" : Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Max(WellVolume) for"]) # Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1]) if Param1 == "Max(FluidComposition) for" : Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Max(FluidComposition) for"]) # Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1]) if Param1 == "Min(FluidComposition) for" : Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Min(FluidComposition) for"]) # Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1]) if Param1 == "Avg(WellVolumne) for" : Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Avg(WellVolumne) for"]) # Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1]) if Param1 == "Avg(FluidComposition) for" : Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns["Min(FluidComposition) for"]) # Vis1.As[TablePlot]().TableColumns.Add(myDataTable.Columns[Param1]) Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted August 7, 2019 Share Posted August 7, 2019 Is the option "Add new columns automatically" checked in the Table Plot Properties - Columns If not you can set in using script as well, Vis1.As[TablePlot]().AutoAddNewColumns=True 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