Tag: ironpython

During Development, Version-Saving is Key

One of the most frustrating things about Spotfire is when it crashes unexpectedly. This could be a result of a multitude of things unbeknownst to the user. In addition, there is no report to describe what caused the error and crash. Recently, I ran into this issue with a tab (or page) in my dashboard. Spotfire would crash if I:

  • left-clicked on the tab name,
  • tried to navigate to the page using a control property button,
  • or right-clicked on the tab to access the “delete page” option.
Since it’s not a good idea to leave this tab in the dashboard, I had to find a way to delete it. Fortunately, there is a way to do this in IronPython.
By running the following script, I was able to easily delete this “page”.
from Spotfire.Dxp.Application import Document
for page in Application.Document.Pages:</div>
     if (page.Title == 'Page'):
     print page.Id
     Application.Document.Pages.Remove(page)
Luckily, I had been saving previous versions during development and could reference an older version to rebuild this tab.