MicroStrategy ONE
Generating a Data Mart Table
The following code sample illustrates how to generate a data mart by executing a data mart report instance.
Code sample
This code sample assumes that a valid data mart report instance exists. Otherwise, it throws an exception.
public voidgenerateDatamartTable() throws Exception{
//assumes sample report is an existing datamart report
//create a report bean instance of a data mart report - that is, a report that has been set as a data mart report.
//Sample code for the getReportBean method used in line 3 is provided for you in the Examples topic.
ReportBean rb = getReportBean("Datamart Report");
WebReportInstance inst = rb.getReportInstance();
//sets the execution flag to indicate that this report should be executed only as a data mart - that is,
//the report should be run, data should be put in the data mart table, but the results should not be returned
rb.setExecutionFlags(EnumDSSXLExecutionFlags.DssXmlExecutionGenerateDatamart);
//Applies the changes to the report bean instance
rb.collectData();
}