Interface WebReportInstance

  • All Superinterfaces:
    EnumWebPersistableState, Persistable, WebResultSetInstance, WebViewInstance

    public interface WebReportInstance
    extends WebViewInstance, WebResultSetInstance

    The WebReportInstance interface represents an instance of a report. A report instance is identified by its message ID and state. This interface can be used to retrieve the results of a report, to access its template (encapsulated by WebViewInstance), filter, or working set, or to obtain several of the other objects which allow report manipulation. The WebReportInstance can be obtained from the WebReportSource interface or from a method which performs any type of report manipulation.

    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Detail

      • getTemplate

        WebTemplate getTemplate​(boolean populate)
                         throws WebObjectsException
        Deprecated.
        WebViewInstance.getTemplate() should suffice all use cases for getting template. Note that getTemplate() always ensures that a populated template is returned. The template population is currently asynchronous. In future release, the template population would be tied to a report instance property e.g. WebResultSetInstance.setAsync(boolean)
        Returns a WebTemplate object, referring to the template contained on this report. If populate is true, then the template will be populated with the current definition of the template according to the Intelligence Server. If it is false, then an empty template will be returned, and it must be populated from an existing template XML. This functionality is primarily used to avoid returning to the server to reload template XML for every web page.
        Parameters:
        populate - If this is true, then the template will be obtained from the Intelligence Server.
        Returns:
        A WebTemplate object which contains the template information for this report instance.
        Throws:
        WebObjectsException - Indicates an inability to obtain the template definition from the Intelligence Server.
      • getFilter

        WebFilter getFilter()
                     throws WebObjectsException
        Returns the current state of the view filter object, according to the Intelligence Server.
        Returns:
        A WebFilter object, which represents the current state of the view filter. This can be used to modify the view filter.
        Throws:
        WebObjectsException - Signals an error occurred while obtaining the view filter XML from the Intelligence Server.
      • getFilter

        WebFilter getFilter​(boolean populate)
                     throws WebObjectsException
        Deprecated.
        getFilter() should suffice all use cases for getting filter. Note that getFilter() always ensures that a populated filter is returned. The filter population is currently asynchronous. In future release, the filter population would be tied to a report instance property e.g. WebResultSetInstance.setAsync(boolean)
        Returns a WebFilter object, which can be used to modify the report's view filter. The populate argument will tell whether or not the returned WebFilter should be populated with XML from the Intelligence server. If populate is false, then an empty WebFilter object should be returned instead.
        Parameters:
        populate - True if the returned filter should be populated, false if it should not be populated before returning.
        Returns:
        A WebFilter object, which can be used to modify the view filter.
        Throws:
        WebObjectsException - Signals an error occurred while obtaining the view filter XML from the Intelligence Server.
      • getLogMessageAsXML

        java.lang.String getLogMessageAsXML()
                                     throws WebObjectsException
        Returns log message for the current report. The parse method didn't provide here, if you want to parse the log message, please refer to com.microstrategy.MSTRTester.MSTRTesterModel#parseToMap(java.io.BufferedReader) and com.microstrategy.MSTRTester.MSTRTesterModel#parseToCSV(com.microstrategy.utils.json.JSONObject) for more detail
        Returns:
        log message for the current report.
        Throws:
        WebObjectsException - indicates an inability to obtain the message information from the Intelligence Server.
      • getResultsAsXML

        java.lang.String getResultsAsXML()
                                  throws WebObjectsException
        Attempts to obtain the report results from the Intelligence Server, and return those results in XML format. For a page-by report, only the current page is returned. To retrieve another page, you need to call WebTemplateUnit.setCurrentElement(String) or WebTemplateUnit.setCurrentElement(String, int) to switch to another page. After that, you need to obtain the results again.
        Returns:
        The resultant report XML, or an empty string if it is not yet ready.
        Throws:
        WebObjectsException - Thrown if the method has difficulty in contacting the Intelligence Server.
      • getResultsAsJSON

        java.lang.String getResultsAsJSON()
                                   throws WebObjectsException
        Attempts to obtain the report results from the Intelligence Server, and return those results in JSON format.
        Returns:
        The resulting report JSON, or an empty string if it is not yet ready.
        Throws:
        WebObjectsException - Thrown if the method has difficulty in contacting For compressed JSON, the return is an Object, instancof String or byte[] the Intelligence Server.
      • getResultFlags

        int getResultFlags()
        Returns the current result flags setting, which determines the information which the Intelligence Server will return in its report XML.
        Returns:
        The current result flags setting; this value should be the bitwise or (|) of values from EnumDSSXMLResultFlags.
        See Also:
        setResultFlags(int)
      • setResultFlags

        void setResultFlags​(int resultFlags)
        Sets the current result flags setting, which determines the information which the Intelligence Server will return in its report XML.
        Parameters:
        resultFlags - The desired result flags setting; this value should be the bitwise or (|) of values from EnumDSSXMLResultFlags.
        See Also:
        getResultFlags()
      • getResultWindow

        WebResultWindow getResultWindow()
        Returns a WebResultWindow object, which can be used to modify the report window being returned from the Intelligence Server.
        Returns:
        A WebResultWindow object, which can be used to modify several window-related settings. A reference to this object will be kept internally, and when necessary, the WebReportInstance object will query the WebResultWindow object in order to obtain the user's settings.
      • getWorkingSet

        WebWorkingSet getWorkingSet()
                             throws WebObjectsException
        Returns a WebWorkingSet object, which can be used to get the working set objects, the base filter of a report instance, or perform other operations relating to the working set of the report. The working set population from IServer is currently asynchronous. In future release, it would be tied to a report instance property e.g. WebResultSetInstance.setAsync(boolean)
        Specified by:
        getWorkingSet in interface WebViewInstance
        Returns:
        A WebWorkingSet object which gives access to working set functionality.
        Throws:
        WebObjectsException - Thrown if the working set XML is not cached in the report instance, and an error occurs when retrieving it from the Intelligence Server.
      • getReportManipulator

        WebReportManipulation getReportManipulator()
                                            throws WebObjectsException
        Returns a WebReportManipulation object, which allow the setting of options and submission of a report manipulation operation. The check to ensure ready status is currently asynchronous. In future release, it would be tied to a report instance property e.g. WebResultSetInstance.setAsync(boolean)
        Returns:
        A WebReportManipulation object, which can be used to make manipulations to the current report instance. The default execution flag in this object will be EnumDSSXMLExecutionFlags.DssXmlExecutionUseCache | EnumDSSXMLExecutionFlags.DssXmlExecutionUpdateCache, and the default result flags will be EnumDSSXMLResultFlags.DssXmlResultPreserve | EnumDSSXMLResultFlags.DssXmlResultNoDerivedPromptXML.
        Throws:
        WebObjectsException - Thrown if the report is not determined to be in the correct state.
      • getGraphObject

        WebGraph getGraphObject()
                         throws WebObjectsException
        Returns a WebGraph object, which allows a user to manipulate and load a graph data stream. This object would normally be used in a interface page or component that outputs a binary stream representing the graph image.Given the session ID, message ID and state ID of the report to be graphed. Other properties may be changed to manipulate the style of that graph produced.
        Specified by:
        getGraphObject in interface WebViewInstance
        Returns:
        A WebGraph object for this report instance.
        Throws:
        WebObjectsException - Thrown if the report is not determined to be in the correct state.
      • setSaveAsFlags

        void setSaveAsFlags​(int saveAsFlags)
        Sets the flags for the saveAs call. These flags determine what is saved and the state it is saved in. This value should be the bitwise or (|) of values from EnumDSSXMLReportSaveAsFlags.
        Parameters:
        saveAsFlags - The value to use as the save as flags.
        See Also:
        getSaveAsFlags()
      • getSaveAsFlags

        int getSaveAsFlags()
        Returns the flags for the saveAs call. These flags determine what is saved and the state it is saved in. This value should be the bitwise or (|) of values from EnumDSSXMLReportSaveAsFlags.
        Returns:
        The current setting of the save as flags.
        See Also:
        setSaveAsFlags(int)
      • getSaveStateID

        int getSaveStateID()
        Returns the current save state ID set on the report instance.
        Returns:
        The save state ID of the report instance.
        Since:
        MicroStrategy Web 9.3.1
      • setSaveAsDisplayMode

        void setSaveAsDisplayMode​(int saveAsDisplayMode)
        Sets the display mode for the saveAs call. These flags determine the format that the report is saved in. This value should be from EnumDSSXMLDisplayMode.
        Parameters:
        saveAsDisplayMode - The value to use as the save as display mode.
        See Also:
        getSaveAsDisplayMode()
      • getSaveAsDisplayMode

        int getSaveAsDisplayMode()
        Returns the display mode for the saveAs call. These flags determine the format that the report is saved in. This value should be from EnumDSSXMLDisplayMode.
        Returns:
        The current setting for display mode.
        See Also:
        setSaveAsDisplayMode(int)
      • saveAs

        WebObjectInfo saveAs​(WebFolder parentFolder)
                      throws WebObjectsException
        Saves the current report instance, or template of the current report instance, or filter of the current report instance into the given folder with the given name and description. The saveAsFlags and saveAsDisplayMode control how the object is saved. One flag in saveAsFlags controls whether to save the report or template or filter of the current report. The new saved object returned without being populated.
        Parameters:
        parentFolder - The folder to place the new report in, an object of type WebFolder.
        Returns:
        The WebObjectInfo object of saved object, it can be report or a filter or a template.
        Throws:
        WebObjectsException - Signals an error in sending the command to the Intelligence Server, or receiving of an invalid DSS ID from the IServer corresponding to the saved object.
      • saveAs

        WebObjectInfo saveAs​(WebFolder parentFolder,
                             java.lang.String name,
                             java.lang.String description)
                      throws WebObjectsException
        Saves the current report instance, or template of the current report instance, or filter of the current report instance into the given folder with the given name and description. The saveAsFlags and saveAsDisplayMode control how the object is saved. One flag in saveAsFlags controls whether to save the report or template or filter of the current report. The new saved object returned without being populated.
        Parameters:
        parentFolder - The folder to place the new report in, an object of type WebFolder.
        name - The name of the new object to be saved.
        description - The description of the new object.
        Returns:
        The WebObjectInfo object of saved object, it can be report or a filter or a template.
        Throws:
        WebObjectsException - Signals an error in sending the command to the Intelligence Server, receiving of an invalid DSS ID from the IServer corresponding to the saved object, or an invalid object name.
      • saveAs

        WebObjectInfo saveAs​(WebFolder parentFolder,
                             java.lang.String name)
                      throws WebObjectsException
        Saves the current report instance, or template of the current report instance, or filter of the current report instance into the given folder with the given name and description. The saveAsFlags and saveAsDisplayMode control how the object is saved. One flag in saveAsFlags controls whether to save the report or template or filter of the current report. The new saved object returned without being populated.
        Parameters:
        parentFolder - The folder to place the new report in, an object of type WebFolder.
        name - The name of the new object to be saved.
        Returns:
        The WebObjectInfo object of saved object, it can be report or a filter or a template.
        Throws:
        WebObjectsException - Signals an error in sending the command to the Intelligence Server, receiving of an invalid DSS ID from the IServer corresponding to the saved object, or an invalid object name.
      • directSave

        WebReportInstance directSave​(int saveAsDisplayMode)
                              throws WebObjectsException
        Direct save the current report instance.
        Parameters:
        saveAsDisplayMode - The value to use as the save as display mode.
        Returns:
        The new report instance.
        Throws:
        WebObjectsException
      • directSave

        WebReportInstance directSave​(int saveAsDisplayMode,
                                     java.lang.String desc)
                              throws WebObjectsException
        Direct save the current report instance.
        Parameters:
        saveAsDisplayMode - The value to use as the save as display mode.
        desc - The description of the report
        Returns:
        The new report instance.
        Throws:
        WebObjectsException
      • directSave

        WebReportInstance directSave​(int saveAsDisplayMode,
                                     java.lang.String desc,
                                     int saveFlags)
                              throws WebObjectsException
        Direct save the current report instance.
        Parameters:
        saveAsDisplayMode - The value to use as the save as display mode.
        desc - The description of the report
        saveFlags - current options of what flags are set to save the report
        Returns:
        The new report instance.
        Throws:
        WebObjectsException
      • getMessage

        WebReportMessage getMessage​(boolean populate)
                             throws WebObjectsException
        Returns A WebReportMessage object for the current report. If populate is true, the information is retreived from Intelligence Server.
        Parameters:
        populate - Whether the message should be populated with the inbox information for the message. This may cause an additional call to the Intelligence Server if it is set to true.
        Returns:
        WebReportMessage for the current report.
        Throws:
        WebObjectsException - indicates an inability to obtain the message information from the Intelligence Server.
      • isPrompted

        boolean isPrompted​(boolean includeDormant)
                    throws WebObjectsException
        Returns whether the report is prompted or not. The includeDormant parameter will determine whether dormant prompts should be considered in the result.
        Parameters:
        includeDormant - True if the presence of a dormant prompt should cause this method to return true, false if this method should only consider the report prompted if it contains used prompts.
        Returns:
        Whether the report is prompted.
        Throws:
        WebObjectsException - Throws if an I-Server error occurs or the report is in an unexpected status.
      • getPropertySetFilter

        SimpleList getPropertySetFilter​(int reportObjectType)
        This method modifies the set of report property sets returned from the getPropertySets call. This method returns a SimpleList object which can be used to filter the property sets returned from the getPropertySets call. The way the property sets work is that there is one property set for each value in EnumDSSXMLReportObjects. Each report object type has a SimpleList of Strings as it's filter - if this list is empty, then all properties will be retrieved for this property set. However, if there are one or more property set names in the filter, then only those property sets will be retrieved from the backend when calling getPropertySets with the same object type.
        Parameters:
        reportObjectType - The report object to retrieve the property set filter for; this should be a value from EnumDSSXMLReportObjects.
        Returns:
        A SimpleList object, which contains Strings corresponding to the property sets to retrieve.
      • getPropertySets

        WebPropertyGroup getPropertySets​(int reportObjectType)
                                  throws WebObjectsException
        Returns the WebPropertyGroup for the given report object type. If the property sets have not yet been retrieved from the Intelligence Server, then this method will trigger a call to the Intelligence Server to retrieve those property sets.

        If the property set filter associated with the given report object type is set, then the property set returned will be constrained to only have those property sets in the filter.

        Parameters:
        reportObjectType - The report object whose properties are to be retrieved, from EnumDSSXMLReportObjects.
        Returns:
        The property sets associated with the report object.
        Throws:
        WebObjectsException - Thrown if an error occurs in asking the Intelligence Server for properties.
      • getPropertySet

        WebPropertySet getPropertySet​(int reportObjectType,
                                      java.lang.String propertySetName)
                               throws WebObjectsException,
                                      java.lang.IllegalArgumentException
        Returns the WebPropertySet for the given report object type. If this property set has not yet been retrieved from the Intelligence Server, then this method will trigger a call to the Intelligence Server to retrieve it.
        Parameters:
        reportObjectType - The report object whose properties are to be retrieved, from EnumDSSXMLReportObjects.
        Returns:
        The property set associated with the report object and the name provided.
        Throws:
        WebObjectsException - Thrown if an error occurs in asking the Intelligence
        java.lang.IllegalArgumentException - Thrown if the propertySetName provided is not valid Server for properties.
      • setProperty

        void setProperty​(int reportObjectType,
                         java.lang.String propertySetName,
                         java.lang.String propertyName,
                         java.lang.String value)
                  throws java.lang.IllegalArgumentException,
                         WebObjectsException
        Sets the given property on the given report object to the given value.
        Parameters:
        reportObjectType - The report object which contains the property to change, from EnumDSSXMLReportObjects.
        propertySetName - The name of the property set which contains the property to change.
        propertyName - The name of the property to change.
        value - The value to which the property should be set.
        Throws:
        java.lang.IllegalArgumentException - Thrown if a parameter passed to this method does not make sense.
        WebObjectsException - Thrown if an error occurs when setting the property value.
      • setDefaultForProperty

        void setDefaultForProperty​(int reportObjectType,
                                   java.lang.String propertySetName,
                                   java.lang.String propertyName)
                            throws java.lang.IllegalArgumentException,
                                   WebObjectsException
        Sets the current value for the given property to be its default value.
        Parameters:
        reportObjectType - The report object which contains the property to change, from EnumDSSXMLReportObjects.
        propertySetName - The name of the property set which contains the property to change.
        propertyName - The name of the property to change.
        Throws:
        java.lang.IllegalArgumentException - Thrown if a parameter passed to this method does not make sense.
        WebObjectsException - Thrown if an error occurs when setting the property value.
      • isSerializeReportData

        boolean isSerializeReportData()
        This flag indicates whether the report XML of the actual report data will be saved when serializing.
        Returns:
        The current value for the "serialize report data" flag.
      • setSerializeReportData

        void setSerializeReportData​(boolean serialize)
        Sets the "Serialize Report Data" flag. This flag indicates whether the report XML of the actual report data will be saved when serializing. The default is false.
        Parameters:
        serialize - Whether the flag should be true or false.
      • getSourceTable

        WebTable getSourceTable()
                         throws WebObjectsException
        Returns the source table for the report, if the report comes from an XDA source. Returns null for a report whose source is the warehouse (i.e. a non-XDA report). The returned table can be queried for it's XDA type.
        Returns:
        A WebTable object which describes the source for an XDA-based report, null if the report came from the warehouse.
        Throws:
        WebObjectsException - Thrown if an error occurs.
        Since:
        MicroStrategy Web 8.0.0
      • getExecutionMode

        int getExecutionMode()
        Returns the specified execution mode. If one is not explicitly set, the default value is EnumWebReportExecutionModes.REPORT_MODE_DEFAULT
        Returns:
        the specified execution mode
        Since:
        MicroStrategy Web 8.0.0
      • setExecutionMode

        void setExecutionMode​(int mode)
        Sets the right execution mode. An execution mode indicates what the intended usage of this bean is. This allows for executing the underlying report with the right set of execution flags
        Parameters:
        mode - a value from the enumeration EnumWebReportExecutionModes
        Since:
        MicroStrategy Web 8.0.0
      • getDatamartInfo

        WebDatamart getDatamartInfo​(boolean convertIfNot)
                             throws WebObjectsException
        Retrieves the datamart information as WebDatamart.
        Parameters:
        convertIfNot - indicates whether the current instance should be converted into a datamart report if it is not one already. The method returns null if this is a datamart instance and the boolean parameter is false
        Throws:
        WebObjectsException
        Since:
        MicroStrategy Web 8.0.1
      • isDatamart

        boolean isDatamart()
                    throws WebObjectsException
        Indicates whether the report that this instance corresponds to is a datamart report.
        Throws:
        WebObjectsException
        Since:
        MicroStrategy Web 8.0.1
      • clearDatamartInfo

        void clearDatamartInfo()
        clears the datamart info. This is equivalent to unsetting the datamart.
        Since:
        MicroStrategy Web 8.0.1
      • isDrilled

        boolean isDrilled()
        Indicates whether the report that this instance corresponds to is a drilled report. This is only supported against server versions higher than 8.0.2.
        Since:
        MicroStrategy Web 8.0.2
      • getMDXCube

        WebMDXCube getMDXCube()
                       throws WebObjectsException
        Returns the MDX cube object that is the source for the report, if the report is an MDX report.
        Returns:
        A WebMDXCube object that can be used to browse the cube contents.
        Throws:
        WebObjectsException
        Since:
        MicroStrategy Web 8.0.2
      • getGraphLabels

        WebGraphLabels getGraphLabels​(int labelType)
        Returns the collection WebGraphLabels that represents the list of labels in either the series or categories axis available for the particular graph
        Parameters:
        labelType - from EnumWebGraphLabelType
      • getCubeName

        java.lang.String getCubeName()
        Since:
        MicroStrategy Web 9.0.0
      • getSourceCube

        WebObjectInfo getSourceCube()
        Get the source cube information of view report
        Returns:
        source cube object, and null if no source object
        Throws:
        WebObjectsException
      • getUnitLimit

        WebExpression getUnitLimit​(WebObjectInfo object)
        Returns unit limit associated with the specified report object
        Parameters:
        object -
      • setUnitLimit

        void setUnitLimit​(WebObjectInfo object,
                          WebExpression expr)
        Sets unit limit for the specified report object
        Parameters:
        object -
        expr -
      • setDefaultExpansionLevel

        void setDefaultExpansionLevel​(WebAttribute attribute,
                                      int value)
        Sets the default expansion level for the specified Recursive Attribute. If there is no any limit expression specified for this attribute, then report will contain elements up to specified level.
        Parameters:
        attribute - A recursive attribute within this report
        value - An expansion level - a positive integer starting with 1 or one of the special values:
        • -1 means that all levels shall be present
        • -2 means that the setting from the attribute definition will be used
      • getDefaultExpansionLevel

        int getDefaultExpansionLevel​(WebAttribute attribute)
        Returns the default expansion level for the specified Recursive Attribute.
        Parameters:
        attribute - A recursive attribute within this report
        Returns:
      • isExpansionLevelInhereted

        boolean isExpansionLevelInhereted​(WebAttribute attribute)
        Returns true if the default expansion level was inhereted from the attribute definition
        Returns:
      • removeUnitLimit

        void removeUnitLimit​(java.lang.String unitId)
        Removes unit limit for the specified report object
        Parameters:
        unitId -
      • isRepromptable

        boolean isRepromptable()
      • getEmmaSourceTablesAsJSON

        java.lang.String getEmmaSourceTablesAsJSON()
                                            throws WebObjectsException
        This funnction will get emma source tables information in the emma cube.
        Returns:
        json result returned from iserver
        Throws:
        WebObjectsException
        Since:
        MicroStrategy Web 10.7
      • getGatewayJsonVersion

        int getGatewayJsonVersion()
        gatewayJsonVersion is transient property for gateway JSON generation. It is currently only used for gateway JSON generation workflow Version 1: all attributes in rows and metrics in column; Subtotal not supported; Result in de-normalized JSON tree structure Version 2: Normalized JSON structure including lookup table for attribute elements, row and column headers; Cross-tab and subtotal supported.
      • setGatewayJsonVersion

        void setGatewayJsonVersion​(int version)