Jump to content

IronPython - AddExpressionRule error in Spotfire 14.0


Lara McGuire 2
Go to solution Solved by Lara McGuire 2,

Recommended Posts

We are upgrading from 11.4 to 14.0 and in testing I found this expression is no longer working when trying to add a rule to a graphical table calculated column:

Original Expression: NewColumn.ValueAxis.Rules.AddExpressionRule('<Expression>',Color.FromName("Red"),0)

I can see that "AddExpressionRule(String, Color, FontStyle)" was replaced with "AddExpressionRule(String, Color, FontStyleFlags)".

I am getting this error: TypeError: Multiple targets could match: AddExpressionRule(str, Color, FontStyle), AddExpressionRule(str, Color, FontStyleFlags)
 

Link to comment
Share on other sites

  • Solution

I solved this by explicitly providing the appropriate parameter type when calling the method:

NewColumn.ValueAxis.Rules.AddExpressionRule('<Expression>',Color.FromName("Red"),FontStyleFlags(0))

and by defining the class at the top of the script:

from Spotfire.Dxp.Framework.Styles import *

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...