Forum Discussion

100Rub's avatar
100Rub
New Contributor III
10 months ago

How to open a Dashboard within the same page when button is clicked

Hi,

Is there a way to open a dashboard within the same page of a dashboard by clicking a button in OneStream?

Thanks

5 Replies

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    Dynamically updating a displayed dashboard within a frame:

    1. Create a parameter that holds the name of the dashboard you want to display e.g. prm_displaydashName. 
    2. Create a dashboard called "PlaceHolder"
    3. Place the embedded dashboard component created for "PlaceHolder" as a component in the frame where you want to control e.g. 0_OuterFrame
    4. In the placeholder embedded dashboard properties, set the Embedded Dashboard property to the parameter for step 1. |!prm_displayDashName!|
    5. Create a dashboard extender br to handle the button click e.g. DashDisplayHelper *see below
    6. In the Button used to change the displayed dashboard, pass in the name of the dashboard to display by updating
      1. Server Task - Selection Changed Server Task to : Execute Dashboard Extender Business Rule (General Server)
      2. Server Task - Selection Changed Server Task Arguments: {DashDisplayHelper}{UpdateDisplayedDashboard}{dashboardToDisplay=|!prm_displayDashName!|}
      3. User Interface Action - Selection Changes User Interface Action: Refresh
      4. User Interface Action - Dashboards to Redraw: 0_OuterFrame
    Namespace OneStream.BusinessRule.DashboardExtender.DashDisplayHelper
    
        Public Class MainClass
    
            Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardExtenderArgs) As Object
                Try
                    Select Case args.FunctionType
                        Case DashboardExtenderFunctionType.ComponentSelectionChanged
                            If args.FunctionName.XFEqualsIgnoreCase("UpdateDisplayedDashboard") Then
                                Dim dashboardToDisplay As String = args.NameValuePairs.XFGetValue("dashboardToDisplay", String.Empty)
    
                                Dim modifiedSubVars As New Dictionary(Of String, String) From {
                                    {"prm_displayDashName", dashboardToDisplay}
                                }
    
                                Dim taskResult As New XFSelectionChangedTaskResult()
                                taskResult.ModifiedCustomSubstVars = modifiedSubVars
                                taskResult.ChangeCustomSubstVarsInDashboard = True
    
                                Return taskResult
                            End If
                    End Select
    
                    Return Nothing
    
                Catch ex As Exception
                    Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
                End Try
            End Function
    
        End Class
    
    End Namespace

     

  • HI 100Rub ,

    Not sure if that is exactly what you fishing for. But you can either:

    Create Button to Open in a Dialog

    Open in a New Page

    ā€ƒ

    • aformenti's avatar
      aformenti
      Contributor II

      Alternatively, if you need to remain in the same page, you should be setting the content of the Dashboard through a parameter like this:

      Then you need to create a Embedded Dashboard component and pass in your Param:

      Finally, your Dashboard page should reference the Embedded Dashboard component which will be set up by the button click. 

      • pranav46's avatar
        pranav46
        Contributor II

        We tried exact steps but somehow, it's not working. If we hard code the value to parameter, then it works but button is not able to pass the value to parameter.