Ever since MicroStrategy introduced “Flash View” mode in their dashboards, it has been a very popular choice for developers looking to introduce interactivity in their dashboards. MicroStrategy also introduced the Visualization SDK along with Flex development tools to create custom Flash widgets.
However in recent years, Flash as a technology is being slowly phased out. This means that most companies that have invested in building solutions using Flex will eventually have to think about moving to DHTML-based solutions.
Early adopters beware - There are some advantages with Flash that users might miss if they make the transition to DHTML. In my opinion the biggest would be the ability to work offline. Flash dashboards allow us to export the whole dashboard as an MHTML file or a more platform agnostic Flash-embedded PDF file. These files essentially act as self-contained dashboards that can work on a client machine. The size of the file will be dependent on the amount of data being brought back along with the number of controls and panels used to create the dashboard. These Flash-embedded PDF files have been popular with users over the years.
For our custom DHTML widgets, we have been using the new Mojo Framework. Building widgets using this framework allows us to target out-of-the-box (OOTB) controls and datasets just as we would with OOTB widgets.
I’ll be adding more implementation details and videos in future posts but for now I’ll provide a high-level overview of this approach.
Mojo Visualization Framework
The new approach requires us to create two styles:
While registering a widget, we need to specify a name for the widget and a style pointing to a Java class that will be invoked when the widget is chosen. This is the style mentioned in the first bullet-point above.
Once the widget is registered, it will show up in the list of widgets in the widget menu. In the screenshot below, we have registered a widget called JQPlot Bar Chart.
As shown above, the widget is registered as a style that points to an OOTB transform (ReportAjaxMojoVisualizationTransform). This Java class contains formal parameters that will be used to render the widget. The formal parameters are as follows:
containerHeight: Corresponds to the height of the widget
containerWidth: Corresponds to the width of the widget
eportXMLStyle: This parameter points to a style that will retrieve data in a custom JSON format. In the above example, we have created a style called CustomMojoVisualizationDataStyle that points to a custom transform. This custom Java class will contain all the logic to retrieve data from the grid that the widget points to and render it in the format that we require. As a good practice, the transform should contain a formal parameter called contentType. The content type can be either JSON or XML (or some other structure). Thus we can just use one transform to render data in many different styles.
As we can see, the mojo visualization approach is a much more elegant way to develop custom DHTML widgets. It also allows us to maintain interactivity with OOTB components of the dashboard.
As we can see, the chart is rendered on a MicroStrategy grid with Tutorial data.