在 Spotfire 的可视化中识别 table

Identify table in visualization in Spotfire

我正在尝试使用脚本来确定 table 数据 table 可视化指的是哪个。我不想依赖名称,以防万一有人更改它并且它不再反映数据 table。有没有办法做到这一点?我已经包含了循环浏览页面和可视化并到达那里的代码。

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

谢谢你的帮助

这应该得到数据table名称

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