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

早过忘川 提交于 2019-12-12 17:26:37

问题


Currently I need to change the name of a column depending on specific criteria but to do that I'd like to refer to that column by its ExternalName rather than its name.

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

unfortunately this doesn't work.

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

回答1:


you're very close! ExternalName isn't a property of the DataColumn object, which is, I suppose you've figured out, why your approach isn't working.

in fact, ExternalName is an item represented by the DataColumnProperties.DefaultProperties class. you would actually access this as if it were a custom-defined Column Property like so:

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

print(col_ext_name)

>> index_id


来源:https://stackoverflow.com/questions/33045805/how-can-i-get-the-externalname-of-a-column-using-ironpython-in-spotfire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!