Search code examples
ironpythonspotfire

I want to navigate to the desired page when I click on any cell in Cross table (Spotfire 7.11)


from Spotfire.Dxp.Application import Bookmark

from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager

from Spotfire.Dxp.Application import BookmarkComponentFlags

from Spotfire.Dxp.Application import Page

Page1==Document.Properties['PageName']

if Page1="First Year"
Document.ActivePageReference=Document.Pages[1]

https://community.tibco.com/questions/how-navigate-another-page-when-click-cross-table


Solution

  • Your IronPython has a couple of errors. Here is a fixed version. When you set the value of Page1 from the document property, you need to use one equals instead of two. And then when you check if Page1 is equal to "First Year", you need to use two equals instead of one. Finally, you need a colon after the if statement.

    from Spotfire.Dxp.Application import Bookmark
    from Spotfire.Dxp.Application.AnalyticItems import BookmarkManager
    from Spotfire.Dxp.Application import BookmarkComponentFlags
    from Spotfire.Dxp.Application import Page
    Page1=Document.Properties['PageName']
    print Page1
    if Page1=="First Year":
        Document.ActivePageReference=Document.Pages[1]
    

    That takes care of the script. Now the cross table. Spotfire does not allow a response to a click on a cross table. You will need to use a graphical table for this. You can create the same table using a graphical table instead of a cross table. It is a bit more work as you need to add a calculated value axis and then connect the IronPython script under the Actions of the axis.