MicroStrategy ONE
Hiding Toolbar Items Based on Feature Availability
Sometimes you want a toolbar item not to be displayed when certain conditions are met, rather than removing it for all users in all situations. This customization scenario illustrates how to hide a toolbar item based on whether a specified Web Feature is available. Web Features is a generic term for a variety of preferences, privileges, settings, etc. that can be used to control the functionality available to the end-user— in this case, whether a toolbar item is visible or hidden.
In this scenario, you add a feature check for the sort shortcut on the Report Execution page so that the "sort" icon ( ) is visible only when the report is displayed as a grid. The feature/privilege to be checked and the associated functionality (visible/hidden) are set in the XML toolbar definition file. The sort icon is available in the Tools as well as the Data toolbar; thus you need to modify two XML toolbar definition files.
Grid Report View
Before customization:
After customization:
Graph Report View
Before customization:
After customization:
This customization can be accomplished using either of the following methods:
Deploying the plug-in provided with MicroStrategy SDK
MicroStrategy SDK provides a plug-in (ZIP file) that can simply be extracted to thepluginsfolder to view the customization in MicroStrategy Web. The following steps guide you in locating the plug-in and deploying it.
-
Access the plug-in: JSP version or ASP .NET version.
-
Extract the plug-in to the plugins subfolder inside the MicroStrategy Web installation folder.
-
Launch MicroStrategy Web to view the customization.
Using the Web Customization Editor to create a plug-in
MicroStrategy SDK provides a Web Customization Editor that can be used to create a customization plug-in. The following steps guide you in creating the plug-in and deploying it.
-
Click on MicroStrategy Web Configuration inside the Application Settings view to expand the hierarchical tree. The expanded list comprises the different settings that can be modified to perform customization.
-
Navigate to Toolbars->ReportDataToolbarModel->tbSort (Sort...).
-
Right-click tbSort (Sort...) and select Edit Toolbar Element. This launchesthe Edit Toolbar Element Wizard.
-
Update the value of Select the feature that will determine whether this toolbar element should be shown to web-sort;check-grid-mode.
-
Update the value of Type in the listener method to ongridselectionschange.
-
Click Finish.
-
Navigate to Toolbars->ReportViewToolbarModel->tbSortButtons (Show sort buttons).
-
Right-click tbSortButtons (Show sort buttons) and select Edit Toolbar Element. This launches the Edit Toolbar Element Wizard.
-
Update the value of Select the feature that will determine whether this toolbar element should be shown to web-sort;is-viewable-report;check-grid-mode.
-
Click Finish.
-
Launch MicroStrategy Web to view the customization.
See Also