#This scirpt does not detect what datatables rely on tables from current analysis
from Spotfire.Dxp.Application.Visuals import VisualContent, VisualTypeIdentifiers
tables={}
for t in Document.Data.Tables:
tables[t.Name]=False
locations = ""
for page in Document.Pages:
for visual in page.Visuals:
if visual.TypeId != VisualTypeIdentifiers.HtmlTextArea:
vis = visual.As[VisualContent]()
dtrtype = str(type(vis.Data.DataTableReference)) if(dtrtype)<>"<type 'NoneType'>": aTable = vis.Data.DataTableReference.Name aLocation = " -> ".join([aTable,page.Title,visual.Title]) tables[aTable]=True locations += "\n\t" + aLocation
print "Tables not being used:"
for t in sorted(tables):
if not tables[t]:print "\t",t
print "\nTables being used:"
for t in sorted(tables):
if tables[t]:print "\t",t
print "\nTables in used by:"
print locations
No comments:
Post a Comment