在 Spotfire 中识别可视化表

时间:2021-03-08 10:00:54

标签: python spotfire

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

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

谢谢你的帮助

1 个答案:

答案 0 :(得分:1)

这应该得到数据表名

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
相关问题