Strategy ONE

Viewing the SQL for a Report Using the URL API

The table below shows the URL parameters used to view the SQL for a report.

Argument Description

evt

3021 - getReportDetails

Allows users to get details about a report

src

The page component that should handle the action and the event

reportID

Specifies the ID of the report

Using the URL API to view the SQL for a report actually displays the Report Details page for a report. The Report Details page shows various information for a report including the SQL used for generating the report data. The URL API can be used to access various MicroStrategy Web pages such as the Report Details page so long as the page knows how to handle specific arguments.

In this example, you need to pass the reportID of the report for which you wish to view the SQL to the Report Details page. By default, the Report Details page is not aware of the reportID argument. Thus, you need to use the Web Customization Editor to add reportID as the request property to the reportBean used on the Report Details page. Once this is done, you can use the URL API to view the SQL for a report as shown in the sample URL below.

Adding reportID as the request property to the reportBean used on the Report Details page

  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. Navigate to reportdetails (Report Details)->Beans to expand the list of beans used by the reportdetails (Report Details) page. 

  5. Double-click rb (Type=ReportBean) to open the Bean Properties editor. 

  6. Select the Request Properties tab and click Add...

  7. Select objectID and click >>

  8. Click OK

  9. In the Request Properties panel, change Source and Value for objectID to request and reportID respectively. 

  10. Save your changes. 

  11. Exit the Web Customization Editor.

You can now use the URL API to view the SQL for a report as shown in the sample URL below.

Sample URL

The sample URL shown below illustrates how to display the Report Details page showing the SQL for the "Electronics Revenue vs. Forecast" report, which is part of the MicroStrategy Tutorial project.

J2EE environment:

http://webserver/MicroStrategy/servlet/mstrWeb?

Server=localhost

&Project=MicroStrategy+Tutorial

&Port=0

&uid=Administrator

&pwd=

&src=mstrWeb.3021

&evt=3021

&reportID=EB3CD5D14F4C8C77782AC0882C986B8D

.NET environment:

http://webserver/MicroStrategy/asp/Main.aspx?

Server=localhost

&Project=MicroStrategy+Tutorial

&Port=0

&uid=Administrator

&pwd=

&src=Main.aspx.3021

&evt=3021

&reportID=EB3CD5D14F4C8C77782AC0882C986B8D

See also: