[英]Spotfire - Mark row in table based on Document Property Value through IronPython
我想根據文檔值的值標記一行。 例如,我將有一個文檔屬性 KeySet = K2。 當我運行 IronPython 腳本時,應該標記 T2、K2、2.00 行。
我試圖跟隨
和
https://community.tibco.com/wiki/how-mark-all-filtered-rows-table-using-ironpython-tibco-spotfirer
但我對 IronPython 不太熟悉,所以我不完全知道如何將它們組合成我想要的工作方式。
這可能嗎? 謝謝你。
初始 state:
運行腳本后,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)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.