【问题标题】:Spotfire How To Change Calculate Totals Using Iron PythonSpotfire 如何使用 Iron Python 更改计算总计
【发布时间】:2019-05-29 19:03:50
【问题描述】:

我的 Spotfire 仪表板中有一个交叉表,我正在尝试使用 Iron Python 脚本更改“计算总计”选项。

我在 Spotfire API 上找到了this link。因此,据我了解,此信息存储在 myVis.Totals 中。但是,无论出于何种原因,这似乎是一个只读属性,如 here 所示。

你们中有人遇到过这个问题并且知道如何解决吗?

这是我的代码:

from Spotfire.Dxp.Application.Visuals import *

# myVis is a script parameter of the type "Visualisation"
myVis = myVis.As[Visualization]()
myVis.Totals = CrossTableTotals.CalculationMode.SumOfCellValues

这是我得到的错误:

Traceback (most recent call last):
  File "<string>", line 5, in <module>
AttributeError: can't assign to read-only property Totals of type 'CrossTablePlot'


System.MissingMemberException: can't assign to read-only property Totals of type 'CrossTablePlot'
   at CallSite.Target(Closure , CallSite , Object , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
   at Spotfire.Dxp.Application.IronPython27.IronPythonScriptEngine.ExecuteForDebugging(String scriptCode, Dictionary`2 scope, Stream outputStream)

【问题讨论】:

    标签: python ironpython spotfire tibco


    【解决方案1】:

    试试这个

    myVis.Totals.DefaultCalculationMode=CrossTableTotals.CalculationMode.SumOfCellValues

    盖亚

    【讨论】:

    • 正是我需要的,盖亚!非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多