我想基于文档值的值标记行。例如,我将具有一个文档属性KeySet = K2。当我运行IronPython脚本时,应标记T2,K2、2.00行。
我正在尝试遵循
和
https://community.tibco.com/wiki/how-mark-all-filtered-rows-table-using-ironpython-tibco-spotfirer
但是我对IronPython不太熟悉,所以我不完全知道如何将它们组合成自己想要的样子。
这可能吗?谢谢。
初始状态:
运行脚本后,标记了T2。
以下是基于文档属性选择来标记行的示例脚本参考
from Spotfire.Dxp.Data import *
selectedValue=Document.Properties["propertyName"]
#Create a cursor to refer a column which will have the values
table=Document.Data.Tables["tableName"]
cursor = DataValueCursor.CreateFormatted(table.Columns["columnName"])
rowCount = table.RowCount
#empty indexset
rowsToMark = IndexSet(rowCount,False)
for row in Document.ActiveDataTableReference.GetRows(cursor):
rowIndex = row.Index
if cursor.CurrentValue == selectedValue:
rowsToMark.AddIndex(rowIndex)
Document.ActiveMarkingSelectionReference.SetSelection(RowSelection(rowsToMark),table)