MicroStrategy ONE

Hiding an Attribute Column Automatically on an Executed Report Grid

There may be instances in which you want certain data that is part of a report definition to be hidden from the end user. For example, suppose you have customized MicroStrategy Web so that when a user selects the Quarter attribute to appear on the report template, your application automatically adds its parent attribute, Year, to the report definition. However, you are capturing this information to display or use in another area of the page, and you do not want the Year attribute to displayed in the report itself.  

In this customization scenario, you cause the Year attribute to be hidden from the end user and replaced by  '---' in the displayed report. It is important to remember that this customization does not change or remove content or data from the report grid itself, but simply hides the content from the user's view. Using this customization improperly can yield a misleading report grid.

Refer to the Report Grid diagram for a better understanding of the various parts of the report grid.

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. 

  1. Access the plug-in: JSP version or ASP .NET version

  2. Extract the plug-in to the plugins subfolder inside the MicroStrategy Web installation folder.   

  3. Launch MicroStrategy Web to view the customization.

For specific settings that affect whether customization changes are applied automatically or require a restart of the Web server, see Applying customization changes to the application.

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. 

  1. Launch the Web Customization Editor

  2. 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 customizations. 

  3. Right-click Styles and select Create Transform to launch the Transform Creation Wizard

  4. Click Browse... next to the Source folder text field to select the src folder and click OK.
     

  5. Enter the following information for the rest of the text fields.

    Package: com.microstrategy.sdk.samples.transforms
    Name
    : ReportGridTransformHideCols
    Transform description
    : This transform hides an attribute column automatically for an executed report.
    Superclass
    : com.microstrategy.web.app.transforms.ReportGridTransformImpl 

  6. Click Next

  7. Click the radio button for Uncheck all methods

  8. Click Next

  9. Click Finish. ReportGridTransformHideCols.java opens in the editor. 

  10. For this scenario, you override the ReportGridTransformHideCols(), onRowHeader(ReportGridCellRowHeader cell, MarkupOutput out) and onRowTitle(ReportGridCellRowTitle cell, MarkupOutput out) methods, and make other modifications as required. The sample, ReportGridTransformHideCols.java, contains the entire code for this custom transform. It creates a custom transform that extends the default transform used to render report grids, ReportGridTransformImpl,and overrides two methods to check for the presence of a specified attribute ID and, if that ID is found, replace the data with dashes in the display. You can use this code in ReportGridTransformHideCols.java that is open for editing. 

  11. Save your changes. 

  12. Click on Styles in the Web Customization Editor to expand the list of styles used in MicroStrategy Web. 

  13. Double-click the ReportGridStyle style. 

  14. Click the Change button next to the Transform text field. 

  15. Enter the name of the transform you created (ReportGridTransformHideCols), select it from the Matching Types results and click OK

  16. Save your changes. 

  17. Launch MicroStrategy Web to view the customization.

For specific settings that affect whether customization changes are applied automatically or require a restart of the Web server, see Applying customization changes to the application.

See Also