简体   繁体   中英

Identify table in visualization in Spotfire

I am trying to identify which table the data table visualizations are referring to using a script. I don't want to rely on the name, in case someone changes it and it does not reflect the data table anymore. Is there a way to do this? I have included the code that cycles through the pages and visualizations and gets there type.

for d in Document.Pages:
    Document.ActivePageReference=d
        for visual in Document.ActivePageReference.Visuals:
           print visual.TypeId
           #here I would like to print the table that is being referred to if it is data table visualization

Thanks for you help

This should get the data table name

from Spotfire.Dxp.Application.Visuals import VisualContent
for d in Document.Pages:
    Document.ActivePageReference=d
    for visual in Document.ActivePageReference.Visuals:
        if visual.TypeId.Name<>'Spotfire.HtmlTextArea':
            #Spotfire.HtmlTextArea don't have data tables
            vis=visual.As[VisualContent]()
            print vis.Data.DataTableReference.Name

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