簡體   English   中英

Spotfire - 通過 IronPython 根據文檔屬性值在表中標記行

[英]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-visualization-based-unmarked-rows-another-visualization-tibco-spotfirer-using

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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM