MicroStrategy ONE

Drilling using Drill Paths

This example demonstrates drilling on a report using one of the default drill paths.

Code sample

This code sample assumes that a valid sessionID, messageID and a stateID exist for the report instance that is drilled. The drillPathID that is the ID of the drill path to be used for drilling is available as well.

 try

 {

   //Get the WebObjectsFactory instance

   WebObjectsFactory factory = WebObjectsFactory.getInstance();

   factory.getIServerSession().setSessionID(sessionID);

 

   //Get the Report Source from the factory

   WebReportSource reportSource = factory.getReportSource();

 

   //Use the Report Source to retrieve the Web Report instance corresponding to the given messageID and stateID

   WebReportInstance reportInstance = reportSource.getInstance(messageID, stateID);

 

   //Get the drill instance for the report instance

   WebDrillInstance drillInstance = reportInstance.getDrillInstance();

 

   //Load the drill actions that correspond to the drillPathID

   drillInstance.loadActionsFromDrillPath(drillPathID);

 

   //Perform the drilling and gets the new report instance

   WebReportInstance newReportInstance = drillInstance.drill();

 } catch(WebObjectsException e) { Log.logger.log(Level.ERROR, e.getMessage);}