简体   繁体   English

在 Spotfire 的可视化中识别表格

[英]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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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