EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB14676: How to use default prompt answer when executing a report in MicroStrategy Web SDK 9.x


Community Admin

• Strategy


The example provided in this document is provided “as-is” to the user and assumes that the user:

  • Can program, compile (e.g. javac, jikes, etc.), and execute Java programs
  • Can configure environment variables (e.g. JAR files, property files, etc.)
  • Have all the necessary tools to create Java applications (JDK, IDE, etc.)
  • Has access to the Strategy SDK documentation.
  • Has read the customization warning at the bottom of this document

 
PREREQUISITES:
 
For the sample to work, the Strategy Web JAR files must be accessible by the Java Runtime
Environment. The Strategy Web JAR files can be found under:

  • Strategy Web Universal (JSP): {web_root}/WEB-INF/lib directory.
  • Strategy Web (.NET): Program Files\Common Files\Strategy directory.

Note:
 
More elaborate programs will require additional library files and are out of the scope of this document.
 
The sample code below illustrates how to execute prompted report with default prompt answers without waiting for end user's input or supplying prompt answer XML in Strategy Web SDK 9.x. This can be accomplished by setting execution flag EnumDSSXMLExecutionFlags.DssXmlExecutionDefaultPrompt on WebReportSource object, as shown below:


import com.Strategy.web.objects.WebIServerSession;

import com.Strategy.web.objects.WebObjectsException;

import com.Strategy.web.objects.WebObjectsFactory;

import com.Strategy.web.objects.WebReportData;

import com.Strategy.web.objects.WebReportInstance;

import com.Strategy.web.objects.WebReportSource;

import com.Strategy.webapi.EnumDSSXMLAuthModes;

import com.Strategy.webapi.EnumDSSXMLExecutionFlags;

import com.Strategy.webapi.EnumDSSXMLResultFlags;

 

public class RunPromptedReport {
 

public static void main(String[] args) throws WebObjectsException {
 

WebObjectsFactory objectFactory = WebObjectsFactory.getInstance();
 

WebIServerSession serverSession = objectFactory.getIServerSession();

serverSession.setServerPort(0);

serverSession.setAuthMode(EnumDSSXMLAuthModes.DssXmlAuthStandard);

serverSession.setProjectName("Strategy Tutorial");

serverSession.setLogin("administrator");

serverSession.setPassword("");

serverSession.setServerName("test");

 

WebReportSource reportSource = objectFactory.getReportSource();
 

reportSource.setExecutionFlags(EnumDSSXMLExecutionFlags.DssXmlExecutionUpdateCache | EnumDSSXMLExecutionFlags.DssXmlExecutionUseCache | EnumDSSXMLExecutionFlags.DssXmlExecutionDefaultPrompt);

reportSource.setResultFlags(EnumDSSXMLResultFlags.DssXmlResultGrid | EnumDSSXMLResultFlags.DssXmlResultStatusOnlyIfNotReady);

 

WebReportInstance reportInstance = reportSource.getNewInstance("500B9C4E4A96FE5FDE4F1FBD602D1C0A");
 

reportInstance.setMaxWait(-1);

int status = reportInstance.pollStatus();

WebReportData reportData = reportInstance.getResults();

serverSession.closeSession();

}

}

 
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. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.
 


Comment

0 comments

Details

Knowledge Article

Published:

June 23, 2017

Last Updated:

June 23, 2017