Friday, January 13, 2012

URL API hacks for MicroStrategy

Share/Save/Bookmark

This post provides details on the parameters of microstrategy that are exposed by URL API, which can be used to query MicroStrategy data from any external environment(sharepoint/etc.)

Parameters that will be discussed here in the document should be appended/inserted at appropriate places to the Query string or the mstr web url to achieve the functionality.

1. HOW TO ANSWER ATTRIBUTE ELEMENT PROMPTS?
Syntax : &elementPromptAnswers = AttributeGUID;ElementID

Here ElementID is again a combination of AttributeGUID and ID of the actual value or element which is represented as (AttributeGUID:ID)

So the prompt can be answered by using the below url &elementsPromptAnswers=21A808034720FDB2FAA1D3A766CFE861;21A808034720FDB2FAA1D3A766CFE861:136 - Filters report based on the element ID, 136(but not refID, 100)

More Examples :-

&elementsPromptAnswers=21A808034720FDB2FAA1D3A766CFE861; - skips prompt(if optional) and lists all records
&promptAnswerMode = 2 – This can be used as well to skip answering the prompt.

&elementsPromptAnswers=21A808034720FDB2FAA1D3A766CFE861;21A808034720FDB2FAA1D3A766CFE861:100 - Filters report based on the element ID - 100(but not refID)

&elementsPromptAnswers=21A808034720FDB2FAA1D3A766CFE861;21A808034720FDB2FAA1D3A766CFE861:100;21A808034720FDB2FAA1D3A766CFE861:15 - Filters based on mulitple values(100,15) or answering the prompts with multiple values for a single attribute.

&elementsPromptAnswers=21A808034720FDB2FAA1D3A766CFE861;21A808034720FDB2FAA1D3A766CFE861:100,545E8F824DA123EB7CB3B5BAA9FA0529;545E8F824DA123EB7CB3B5BAA9FA0529:125 - Filters based on mulitple prompts or answering multiple prompts each with single value.

2. HOW TO EXECUTE MULTIPLE EVENTS?
Syntax: &src=mstrweb.report.{evt1}&evt={evt1}&src=mstrweb.report.{evt2}&evt={evt2}&evtorder={evt1},{evt2}&{evt1}=1&{evt2}=1

For example, to execute a report and then drill it we need to use events 4001(execute), drill(4096010). Also respective src attributes to be set on which the mstr events(Actions) need to be performed. Finally let microstrategy know the order the events to be raised

Example: http://localhost:8080/webserver/servlet/mstrweb?project=mstrdemo
&evt=4001&src=mstrweb.report.4001&reportID={GUID}&elementPromptAnswers={guid}
&evt=4096010&src=mstrwe.reportrb.vb.4096010&elementList=1A1A0&drillPathKey=0.21.1.1
&retainParent=3&retainThresh=3&evtorder=4001,4096010&4001=1&4096010=1


3. HOW TO TOGGLE THE THRESHOLDS?
Use the event,4066 and param enable(0/1)
Syntax: evt=4066&src=mstrweb&enable=(0-off,1-on)


4. HOW TO OPEN A REPORT WITH “FILTER ON SELECTIONS” ENABLED BY DEFAULT?
Use event,6011
Syntax : &evt=6011


5. HOW TO REMOVE SECTIONS/PANES FROM A REPORT ?
Syntax : &evt=4001&src=mstrWeb.[Option].4001
Option includes one among the below :
- reportNoHeader
- reportNoHeaderNoFooter
- reportNoHeaderNoFooterNoPath
- reportNoHeaderNoFooterNoPathNoToolbar

Example :
&evt=4001&src=mstrWeb.reportNoHeaderNoFooterNoPathNoToolbar.4001

Alternative is &hiddenSections=header,footer,path,dockTop (applicable > 9.0 version)
&reportDetails=0 – Removes report details pane from view
&promptDetails=0 - Removes prompt details pane from view
&vfep=0(view field section)
&vfep=0.-1.0.0


6. EXPORT OPTIONS
Grid Format : &evt=3012&exportFormatGrids=htmlGrids&reportID=E638352311D5C49EC0000C881FDA1A4F

Pdf Format : &evt=3062&src=mstrWeb.3062&showOptionsPage=false
(url should not have reportNoHeaderNoFooterNoPathNoToolbar set)


7. PRESENTATION/VIEW MODES
&reportViewMode=1 (grid)
&reportViewMode=2 (graph)
&reportViewMode=3 (grid/graph)
&visMode=0 (no visualization)
&visMode=51 (AJAX visualization) - this and Flash (50) require that you setup a Custom Visualization in the report definition.
&visMode=50 (Flash visualization)


8. PRESENTATION MODE FOR DOCUMENTS
Syntax : &currentViewMedia={number}

Options :
Interactive DHTML view mode (2)
Flash view mode (8)
Export to Excel (16)
Export to PDF (32)

Example : &currentViewMedia=16


Subscribe

15 comments:

  1. Hi..I am Mark...thank u for sharing such good and valuable information on
    online training for Micrtostrategy

    ...

    ReplyDelete
  2. Thanks for giving Good Example.
    Fantastic article, Viral. Very well written, clear and concise. One of the best links explaining one to many and hierarchy Microstrategy. Thanks a lot.It is uaefull to me and my training Microstrategyonlinetraining center.

    ReplyDelete
  3. Thanks for giving Good Example, It is very useful to us.
    Fantastic article, Viral. Very well written, clear and concise. One of the best links explaining one to many and hierarchy Microstrategy. Thanks a lot.It is uaefull to me and my training Microstrategyonlinetraining center.

    ReplyDelete
  4. Great article, thanks for sharing usefull information and i have seen more info on
    MicroStrategy Online Training

    ReplyDelete