MicroStrategy ONE

Adding Extra Arguments to an Existing Event for Report Execution

There may be instances in which you want to customize an existing event by adding extra arguments, or parameters. For example, you might want to add new parameters to the report's Execute event to restrict the number of rows/columns that can be viewed in a report grid at run-time.

In this customization scenario, you modify the Report Execution page so that a user can specify the maximum number of rows and/or the maximum number of columns through parameters in the request.

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.

Use one of the URLs listed below to execute a report that displays a maximum of four rows and four columns. The original report has more than 10 rows and columns. To specify a different maximum number of rows and/or columns, change the values of the maxGridRows and maxGridCols parameters in the request.

J2EE environment:

Copy
http://webserver/MicroStrategy/servlet/mstrWeb?evt=4001&src=mstrWeb.4001&reportViewMode=1&reportID=2BCDF0E9403A9352617DA29DF37B2BAA&maxGridRows=4&maxGridCols=4:

.NET environment:

Copy
http://webserver/MicroStrategy/asp/Main.aspx?evt=4001&src=Main.aspx.4001&reportViewMode=1&reportID=2BCDF0E9403A9352617DA29DF37B2BAA&maxGridRows=4&maxGridCols=4

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. Create a new plug-in and give it a meaningful name. For example: AddingArgumentsToEvent

  3. Exit the Web Customization Editor. 

  4. Use the Eclipse IDE to create a custom enumeration, EnumCustomReportBeanEvents, that provides names for the custom event arguments you defined (for the REPORT_EVENT_EXECUTE event). The sample, EnumCustomReportBeanEvents.java, contains the entire code for this custom enumeration. This custom enumeration contains the following custom names for the custom argument definitions that you added in the custom event definition file.

    Copy
    ...
      // Integer values for maximum rows and columns arguments
      int REPORT_EVENT_ARGUMENT_GRID_MAX_ROWS = 4020;
      int REPORT_EVENT_ARGUMENT_GRID_MAX_COLUMNS = 4021;
    ...
  5. Compile EnumCustomReportBeanEvents.java and place the class file inside the classes folder of this customization plug-in adhering to the package structure. For example: plugins\AddingArgumentsToEvent\WEB-INF\classes\com\microstrategy\sdk\samples\events

  6. If the Web Customization Editor is closed, launch it again and access your plug-in

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

  8. Click on Pages to expand the list of pages used in MicroStrategy Web. 

  9. Right-click report (Report Execution) and select Create New Add-on. This launches the Add-on Creation wizard

  10. Click Browse to select the source folder for the project. 

  11. Enter com.microstrategy.sdk.samples.addons in the Package text field. 

  12. Enter ReportMaxRowsColsAddOn in the Name text field. 

  13. Enter Restricts number of rows-columns to be viewed in report grid at run-time in the Add-onDescription text field. 

  14. Click Next

  15. Click Finish. ReportMaxRowsColsAddOn.java opens in the editor. The sample, ReportMaxRowsColsAddOn.java, contains the entire code for this custom add-on. 

  16. Save your changes. 

  17. Navigate to MicroStrategy Web Configuration->Events->Event Handler Type (4)->ReportExecuteEvent

  18. Double-click ReportExecuteEvent to launch the Event and Arguments editor in the right frame. 

  19. Click Add

  20. Enter 4020 and maxGridRows in the fields for Argument ID and Argument Name respectively.

  21. Click Add

  22. Enter 4021 and maxGridCols in the fields for ArgumentID and Argument Name respectively. 

  23. Save your changes. 

  24. Launch MicroStrategy Web to view the customization.

Use one of the URLs listed below to execute a report that displays a maximum of four rows and four columns. The original report has more than 10 rows and columns. To specify a different maximum number of rows and/or columns, change the values of the maxGridRows and maxGridCols parameters in the request.:

J2EE environment:

Copy
http://webserver/MicroStrategy/servlet/mstrWeb?evt=4001&src=mstrWeb.4001&reportViewMode=1&reportID=2BCDF0E9403A9352617DA29DF37B2BAA&maxGridRows=4&maxGridCols=4:

.NET environment::

Copy
http://webserver/MicroStrategy/asp/Main.aspx?evt=4001&src=Main.aspx.4001&reportViewMode=1&reportID=2BCDF0E9403A9352617DA29DF37B2BAA&maxGridRows=4&maxGridCols=4