MicroStrategy ONE

Answering a Prompt Question by Supplying Custom Parameters in the URL

Normally, when a user executes a report containing prompts, he or she must answer the prompts manually before the report can be fully executed and the results displayed. However, there may be instances when you want to customize the workflow such that users are not required to manually answer prompts; instead, you provide the prompt answers automatically through some other mechanism, such as the URL. This approach is useful, for example, when you want to allow users to drill from an embedded grid report within the Header section of a document. This approach also lets you create a series of prompted reports to avoid having to maintain hundreds of static reports for different users.

In this customization scenario, you create an add-on that uses prompt answers supplied in the URL to automatically answer prompts and execute a report, without requiring user input. This customization scenario is applicable only to value prompts. Value prompts allow you to use dates, numeric values, big decimal values, or text to qualify on metrics, attribute descriptions, or attribute IDs. This customization scenario involves writing custom code. If you are looking for a solution that does not involve writing any custom code for answering prompts using the URL, refer to the URL API section.

Before customization:

The user must answer prompts manually. When the user executes a report, the Prompt Question page is displayed.

After customization:

When the user accesses the report using a URL containing the prompt answer, the report is displayed immediately without displaying the Prompt Question page.

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.

After you have deployed the plug-in, access any report (prompted on Year) by appending &Year=Value&answerPromptFromURL=true to the URL. The report is displayed immediately without displaying the Prompt Question page. For example:

J2EE environment:

Copy
http://webserver/MicroStrategy/servlet/mstrWeb?Server=IntelligenceServerName&Project=MicroStrategy+Tutorial&Port=0&evt=4001&src=mstrWeb.4001&reportID=AD39BD49418A21A70DE73C9BEE5775D1&reportViewMode=1&Year=Value&answerPromptFromURL=true

.NET environment:

Copy
http://webserver/MicroStrategy/asp/Main.aspx?Server=IntelligenceServerName&Project=MicroStrategy+Tutorial&Port=0&evt=4001&src=Main.aspx.4001&reportID=AD39BD49418A21A70DE73C9BEE5775D1&reportViewMode=1&Year=Value&answerPromptFromURL=true

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. Click on Pages to expand the list of pages used in MicroStrategy Web. 

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

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

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

  7. Enter PromptAutoAnswerAddon in the Name text field. 

  8. Enter Addon to append prompt answers from the URL in the Description text field. 

  9. Click Next

  10. Click Finish. PromptAutoAnswerAddon.java opens in the editor. The sample, PromptAutoAnswerAddon.java, contains the entire code for this custom add-on. The preCollectData() method in this add-on is used to define the rules for applying custom URL parameters (if present) to the prompt answer of the reports 

  11. Save your changes. 

  12. Launch MicroStrategy Web to view the customization.

After you have made these changes, access any report (prompted on Year) by appending &Year=Value&answerPromptFromURL=true to the URL. The report is displayed immediately without displaying the Prompt Question page. For example:

J2EE environment:

Copy
http://webserver/MicroStrategy/servlet/mstrWeb?Server=IntelligenceServerName&Project=MicroStrategy+Tutorial&Port=0&evt=4001&src=mstrWeb.4001&reportID=AD39BD49418A21A70DE73C9BEE5775D1&reportViewMode=1&Year=Value&answerPromptFromURL=true

.NET environment:

Copy
http://webserver/MicroStrategy/asp/Main.aspx?Server=IntelligenceServerName&Project=MicroStrategy+Tutorial&Port=0&evt=4001&src=Main.aspx.4001&reportID=AD39BD49418A21A70DE73C9BEE5775D1&reportViewMode=1&Year=Value&answerPromptFromURL=true

See Also