Answering Multiple Prompts via URL in MicroStrategy

 ̄綄美尐妖づ 提交于 2019-12-25 01:17:26

问题


I'm very new to MicroStrategy and I'm trying to build a URL to navigate to a report bypassing the prompts. The report has 2 prompts for dates, then a multi-select prompt (search/add items from one listbox into another). I can get it to answer the date prompts (bypass them), but I can't figure out how to answer the multi-select prompt via the URL. Here's what I have so far...

This works for the date prompts...

http://SERVERNAME/microstrategy/asp/Main.aspx?Server=SERVERNAME&Project=PROJECTNAME&Port=0&evt=4001&src=Main.aspx.4001&reportID=BC5CAA674A50DB3443440BA94AED6FBB&visMode=0&reportViewMode=1&valuePromptAnswers=1/1/2014^2/02/2014

And here's what I've tried to tack on the end of that...

^3CCBE02841FF006CE442AE8E22DF8B96:346

&elementsPromptAnswers=3CCBE02841FF006CE442AE8E22DF8B96:346

^3CCBE02841FF006CE442AE8E22DF8B96;3CCBE02841FF006CE442AE8E22DF8B96:346

&elementsPromptAnswers=3CCBE02841FF006CE442AE8E22DF8B96;3CCBE02841FF006CE442AE8E22DF8B96:346:{000683%3AFOOD%20PROCUREMENT%20%26%20DISTRIBUTION%20MANAGEMENT%20SERVICES@346}

Contract@3CCBE02841FF006CE442AE8E22DF8B96=346

So, I'm lost. Does anyone have experience with this URL API?

Thanks in advance!


回答1:


Just tried and this should work for a single element prompt at least. When working with two or more just refer to this (great, btw) blog. The most relevant bits are..

&elementsPromptAnswers=AttributeGUID;AttributeGUID:Value

AttributeGUID: just check the OID of the html-element in your browser (oid="...") or look up the attribute ID in MSTR-Desktop.

Value: the ID of the value, not the text-representation. So month should (probably) turn out like 201501

http://SERVERNAME/microstrategy/asp/Main.aspx?Server=SERVERNAME&Project=PROJECTNAME&Port=0&evt=4001&src=Main.aspx.4001&reportID=BC5CAA674A50DB3443440BA94AED6FBB&visMode=0&reportViewMode=1&elementsPromptAnswers=E71D79C54C2B582D86DD3699B5B4A569;E71D79C54C2B582D86DD3699B5B4A569:201501




回答2:


Here's a link to MicroStrategy's documentation on the topic.

Quoting from that page:

The parameter elementsPromptAnswers specifies the answer to a single element prompt or multiple element prompts, with each individual prompt answer in the form of

AttributeID;AttributeElementID^DisplayName

When there are multiple prompt answers, each individual answer is separated by a "," (comma) separator character. In addition, you can include multiple elements to answer the same element prompt by separating each AttributeElementID^DisplayName combination (for the same AttributeID) with the ";" separator character. For example, the following parameter value represents two element prompt answers, the first of which has three different elements to answer the prompt and the second of which has only one element to answer the prompt:

AttrID1;AttrElemID1a^DisplayName1a;AttrElemID1b^DisplayName1b;AttrElemID1c^DisplayName1c,AttrID2;AttrElem2^DisplayName2

To pass the prompt answer for an unanswered optional element prompt in the URL, you simply specify the AttributeID for the unanswered prompt, followed by a semi-colon, but do not include the AttributeElementID.

To pass the prompt answer for an element prompt when the attribute has a compound ID, you separate each AttributeElementID with a colon.

The DisplayName for an element prompt is optional, but without it, the element name does not show up in the prompt details pane in the report page.

Note: Because element prompt answers are matched with prompts using the AttributeID, the order of the prompt answers does not determine the order in which prompts are answered.




回答3:


Quite old... but this is what you needed long time ago... the 'promptsAnswerXML' parameter works fine and it provides you a way to encapsulate all answers!

https://lw.microstrategy.com/msdz/msdl/901/docs/Passing_Prompt_Answers_Using_the_URL_API.htm

Just wrap your report with a doc, insert somewhere the autotext {&PromptXML}, run it, copy the autogenerated xml and append it to the URL. Too easy (see the pictures, extracted from the article).



来源:https://stackoverflow.com/questions/28031896/answering-multiple-prompts-via-url-in-microstrategy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!