The following code can be used to retrieve prompt answer eXtensible Markup Language (XML) using Strategy SDK. The code should be called within postCollectData method of a report execution page addon.
//rb is an instance of ReportBean
//pb is an instance of WebPrompts
pb = rb.getReportInstance().getPrompts();
if (pb != null){
pb.setClosed(false);
String promptShort = pb.getShortAnswerXML();
}
The prompt answer XML can be used to pass prompt answers thru URL API as shown in the following hidden form:
<FORM ACTION="http://localhost/MicroStrategy/asp/Main.aspx?server=was-dwu&project=Strategy+Tutorial&evt=4001&reportID=A20C9D0611D60AE310008BB3D1CEE6A4&uid=Administrator&pwd=" method="POST">
<INPUT type="hidden" name="promptsAnswerXML" value= ' <rsl lcl="1033"><pa pt="7" pin="0" did="D7C729D94173B1D72601B4AD9E439BAE" tp="10"><mi><es dirty="1"><at did="8D679D3711D3E4981000E787EC6DE8A4" tp="12" stp="3072" n="Category" disp_n="Category"/><e ei="8D679D3711D3E4981000E787EC6DE8A4:3" emt="1" art="1" disp_n="Movies" disp_id="1"/></es></mi></pa></rsl> ' >
<INPUT type="submit" value="Send">
</FORM>
</body>
</html>
</body>
</html>
Note that the value attribute of the hidden input is enclosed in single quotes. This prevents any conflicts with the double quotes used in the prompt XML.
Customization Warning:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.