简体   繁体   English

Spotfire IronPython跳过某些表的过滤器

[英]Spotfire IronPython Skip filters from certain table

I am using Spotfire 7.10. 我正在使用Spotfire 7.10。

I have a script, that updates a document property containing the active filters. 我有一个脚本,用于更新包含活动过滤器的文档属性。 To do so, I loop over the filters matching the "status:m" search like so: 为此,我遍历了匹配“ status:m”搜索的过滤器,如下所示:

filterPanel.InteractiveSearchPattern = "status:m"
for filter in filterPanel.FiltersMatchingSearchPattern:
    filteroutput = filter.FilterReference.ToString()
    content += filteroutput + "\n"

I would like to skip over filters coming from Table1, whilst filters in Table2 are supposed to be displayed. 我想跳过来自Table1的过滤器,而应该显示Table2中的过滤器。

Any idea on how to skip over them? 关于如何跳过它们的任何想法吗? Both tables have fields with overlapping names, eg "Color", so i can't go by the name but need a reference to the originating data table. 这两个表的字段都具有重叠的名称,例如“ Color”,因此我不能按名称使用,但需要引用原始数据表。

Any hints are greatly appreciated. 任何提示,不胜感激。

You can use the ParentGroup to determine which table the filter belongs to and then skip the ones you dont need 您可以使用ParentGroup确定过滤器属于哪个表,然后跳过不需要的表

import Spotfire.Dxp.Application.PanelCollection

import Spotfire.Dxp.Application.PanelTypeIdentifiers
from Spotfire.Dxp.Application import Panel
from Spotfire.Dxp.Application.Layout import PanelState as ps
for panel in Document.ActivePageReference.Panels:
 if panel.TypeId.DisplayName == "Filters":
  panel.InteractiveSearchPattern = "status:m"
  for filter in panel.FiltersMatchingSearchPattern:
   filteroutput = filter.FilterReference.ToString()
   print "Table-" + str(filter.Context.ParentGroup.Name) + "---Filter - " +str(filteroutput) 

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

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