簡體   English   中英

如何在Spotfire中使用IronPython獲取列的外部名稱?

[英]How can I get the externalname of a column using IronPython in Spotfire?

當前,我需要根據特定條件來更改列的名稱,但是要做到這一點,我想通過它的ExternalName而不是它的名稱來引用該列。

aColumn = Document.ActiveDataTableReference.Columns["I_id"].Name 

不幸的是,這行不通。

aColumn = Document.ActiveDataTableReference.Columns["I_id"].ExternalName 

你很親密! ExternalName不是DataColumn對象的屬性,我想您已經知道了為什么您的方法不起作用。

實際上, ExternalName是由DataColumnProperties.DefaultProperties表示的項。 您實際上將訪問它,就像它是一個自定義的Column屬性一樣:

col_ext_name = Document.ActiveDataTableReference.Columns["I_id"].Properties["ExternalName"]

print(col_ext_name)

>> index_id

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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