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.
-
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.
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:
http://webserver/MicroStrategy/servlet/mstrWeb?evt=4001&src=mstrWeb.4001&reportViewMode=1&reportID=2BCDF0E9403A9352617DA29DF37B2BAA&maxGridRows=4&maxGridCols=4:
.NET environment:
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.
-
Create a new plug-in and give it a meaningful name. For example: AddingArgumentsToEvent.
-
Exit the Web Customization Editor.
-
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;
... -
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.
-
If the Web Customization Editor is closed, launch it again and access your plug-in.
-
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.
-
Click on Pages to expand the list of pages used in MicroStrategy Web.
-
Right-click report (Report Execution) and select Create New Add-on. This launches the Add-on Creation wizard.
-
Click Browse to select the source folder for the project.
-
Enter com.microstrategy.sdk.samples.addons in the Package text field.
-
Enter ReportMaxRowsColsAddOn in the Name text field.
-
Enter Restricts number of rows-columns to be viewed in report grid at run-time in the Add-onDescription text field.
-
Click Next.
-
Click Finish. ReportMaxRowsColsAddOn.java opens in the editor. The sample, ReportMaxRowsColsAddOn.java, contains the entire code for this custom add-on.
-
Save your changes.
-
Navigate to MicroStrategy Web Configuration->Events->Event Handler Type (4)->ReportExecuteEvent.
-
Double-click ReportExecuteEvent to launch the Event and Arguments editor in the right frame.
-
Click Add.
-
Enter 4020 and maxGridRows in the fields for Argument ID and Argument Name respectively.
-
Click Add.
-
Enter 4021 and maxGridCols in the fields for ArgumentID and Argument Name respectively.
-
Save your changes.
-
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:
http://webserver/MicroStrategy/servlet/mstrWeb?evt=4001&src=mstrWeb.4001&reportViewMode=1&reportID=2BCDF0E9403A9352617DA29DF37B2BAA&maxGridRows=4&maxGridCols=4:
.NET environment::
http://webserver/MicroStrategy/asp/Main.aspx?evt=4001&src=Main.aspx.4001&reportViewMode=1&reportID=2BCDF0E9403A9352617DA29DF37B2BAA&maxGridRows=4&maxGridCols=4