Prince Patni

Spotfire – Toggle Details on Demand visibility via script

Getting details on demand button is quite straightforward in Spotfire, it comes as an inbuilt functionality. But what if you want to toggle it on and off, i.e. to show and hide by clicking on same button? That’s possible via Iron Python scripting.

Lets explore both the methods.

Learn Tibco Spotfire. One of the best BI tools used Industry wide that is also a part of Gartner’s Magic Quadrant ! Click here for a complete course at the Cheapest price !

Getting Details on Demand window by using Spotfire functionality

Lets say you have a bar chart (or any viz) as below. You are supposed to have a button that on clicking, displays the details on demand at the bottom of the page.

Steps –

  1. Insert a text area above.
  2. Right click – Edit HTML
  3. Click the ‘Insert Action Control’, 5th button from left in the toolbar.
  4. Give a display text, like – Details on Demand
  5. Let the Control type be ‘Button’
  6. Under ‘Available Actions’, expand the ‘Functions’ tree by clicking on + sign (See image below).
  7. Under that, expand the ‘View’ tree by clicking on + sign again.
  8. Here you see ‘Details on Demand’. Select it, and click ‘Add’.
  9. Click ‘OK’, close the HTML window.
  10. You have your Details on Demand button as needed.

Select some data, and hit ‘Details on Demand’ button. The window will pop on right/bottom of screen and can be moved around as comfortable.

Toggling Details on Demand window by using Scripting

Steps –

  1. Insert a text area above.
  2. Right click – Edit HTML
  3. Click the ‘Insert Action Control’, 5th button from left in the toolbar.
  4. Give a display text, like – Details on Demand
  5. Let the Control type be ‘Button’
  6. Now click the ‘Script’ button on the left panel, and click ‘New’ from right.
  7. Give your script a descriptive name like Toggle- Details on Demand.
  8. Enter the script as shown in image. Click OK, click OK again, and close the HTML window. Script is given at the last.
  9. Now select some data and hit the button. Details on Demand panel appears. Hit it again and it disappears.
  10. You now have a toggle button for showing / hiding the Details on Demand panel.
if (Document.ActivePageReference.DetailsOnDemandPanel.Visible == False):  
Document.ActivePageReference.DetailsOnDemandPanel.Visible = True else:  
Document.ActivePageReference.DetailsOnDemandPanel.Visible = False

Exit mobile version