简体   繁体   中英

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

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 

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM