MicroStrategy ONE

Executing the Report with the Desired Result Flags

This example demonstrates executing the report with the desired result flags.

Code sample

1. String reportID = "D08450DF4E71E2068B9AE78845C1BA28";
 

2. WebReportSource reptSrc = woFact.getReportSource();
 

3. webSS.getSessionID();
 

4. reptSrc.setResultFlags(EnumDSSXMLResultFlags.DssXmlResultGrid + EnumDSSXMLResultFlags.DssXmlResultPageTreeStyle);
 

5. WebReportInstance rptInst = reptSrc.getNewInstance(reportID);
 

6. rptInst.setAsync(false);
 

7. rptInst.setMaxWait(120000);
 

8. rptInst.setPollingFrequency(250);
 

9. int status = rptInst.pollStatus();
 

10. WebReportData repData = rptInst.getResults();
 

11. WebReportGrid reportGrid = repData.getWebReportGrid();

Explanation

Line 1 sets the reportID for the report. Line 3 sets the session information. Line 4 sets the result flags. Note that the result flags contain the ResultPageTreeStyle option.  This is important for getting the page headers. Line 5 retrieves the report instance and Line 10 obtains the WebReportData object. Line 11 retrieves the WebReportGrid object from the report data.