Dynamic Dashboards Service Type

Dynamic dashboards enable you to modify components within the dashboard as well as modifying the dashboard itself.

Create the service factory assembly file and then the Dynamic Dashboards service. Then, uncomment the appropriate lines of code. The following example is the service factory assembly file in C# with the lines for the Dynamic Dashboards service uncommented.

NOTE: The file name must match the name of the returned function in the service factory file.

Sample Service Factory with a DynamicDashboard that has a yellow highlight line on lines 31-32.

Configure the Dynamic Dashboards service with the following options:

  • In the File Name field, enter a name for the file (for example, WsasDynamicDashboards).

  • In the Source Code Type drop-down menu, select Dynamic Dashboards Service.

  • In the Compiler Action drop-down menu, select (Use Default).

    NOTE: For the Compiler Action options, Disable ignores the file when the assembly is compiled. (Use Default) is the same as Compile.

Add File dialog box displays fields to create a new source file, with File Name set to WsasDynamicDashboards, Source Code Type set to Dynamic Dashboards Service, and Compiler Action set to (Use Default). OK and Cancel buttons at the bottom.

The following example features embedded components that have not been created manually in the Workspaces interface but are generated by the assembly file.

Sample of an dynamic dashboard generated assembly file with a red rectangle box around attributes.

IMPORTANT: Before writing the assembly, ensure the Dashboard Type property is set to Embedded Dynamic. Otherwise, the rule will not run. This is also where you should ensure the Workspace Assembly Service property is set to the service factory assembly file.

There is no special syntax required for referencing this service type.

Existing Dynamic Dashboard service types using VB.NET that were created before Platform Version 9.0.0 require the GetDynamicCubeViewForDynamicComponent function in the source code. If this function is not added to the service type, you will receive the following error.

Message box has error that says Error compiling Workspace Assembly DynamicDashboard VB in workspace Dynamic Dashboard.

To update and compile these service files, complete the following steps:

  1. Copy the following lines of code to add the GetDynamicCubeViewForDynamicComponent method.

    Copy

    GetDynamicCubeViewForDynamicComponent VB.Net Code

    Public Function GetDynamicCubeViewForDynamicComponent(ByVal si As SessionInfo, ByVal api As IWsasDynamicDashboardsApiV800, ByVal workspace As DashboardWorkspace, _
            ByVal maintUnit As DashboardMaintUnit, ByVal dynamicComponentEx As WsDynamicComponentEx, ByVal storedCubeViewItem As CubeViewItem, _
            ByVal customSubstVarsAlreadyResolved As Dictionary(Of String, String)) As WsDynamicCubeViewEx Implements IWsasDynamicDashboardsV800.GetDynamicCubeViewForDynamicComponent
            Try
        
                If api IsNot Nothing Then
                    Return api.GetDynamicCubeViewForDynamicComponent(si, workspace, dynamicComponentEx, storedCubeViewItem, String.Empty, Nothing, TriStateBool.Unknown, WsDynamicItemStateType.Unknown)
                End If
        
                Return Nothing
            Catch ex As Exception
                Throw New XFException(si, ex)
            End Try
        End Function
  2. Paste the code in the Dynamic Dashboard service file that is producing the error. You can paste the full function after the GetDynamicParametersForDynamicComponent method. This is after line 93 in the original source code.

    Code snippet shows public functions in a Dynamic Dashboards service that wrap API calls to retrieve dynamic component parameters and Cube Views. The code to retrieve parameters ends on line 93. The code to retrieve Cube Views starts on line 95.

  3. Select Compile Assembly to compile the assembly file.

IMPORTANT: You can use new functionalities within Platform Version 8.2.0 and later for service types in C#. While new coding options will work in C#, these new functionalities in Platform Version 8.2.0 and later may not be compatible with VB.Net.