Interface WebTemplateSubtotals


  • public interface WebTemplateSubtotals
    The WebTemplateSubtotals object represents the collection of subtotals on a template This object can be used to get the list of available subtotals, active subtotals etc, turn on a subtotal by position (axis), across level (unit) or grouped by some template units. Each object in the collection is of type WebTemplateSubtotal.
    Since:
    MicroStrategy Web 9.0.0
    • Method Detail

      • get

        WebTemplateSubtotal get​(int index)
                         throws java.lang.IndexOutOfBoundsException
        Returns the WebTemplateSubtotal object with the given index in this collection.
        Parameters:
        index - The index to return in the collection.
        Returns:
        The WebTemplateSubtotal object at the given index.
        Throws:
        java.lang.IndexOutOfBoundsException - Thrown if the index does not exist in the collection.
      • getByType

        WebTemplateSubtotal getByType​(int type)
        Returns the WebTemplateSubtotal object with the given type. If no such subtotal with the given type exists for the template, this will return null. If there are more than 1 subtotal with the given type, it will return the first such subtotal
        Parameters:
        type - from EnumDSSXMLMetricType
      • deActivate

        void deActivate​(int index)
                 throws java.lang.IndexOutOfBoundsException
        Inactivates the WebTemplateSubtotal object with the given index in the collection.
        Parameters:
        index - The index of the item to render inactive.
        Throws:
        java.lang.IndexOutOfBoundsException - Thrown if no item with the given index can be found.
      • deActivateAll

        void deActivateAll()
        Inactivates all active subtotal objects from the collection. This will effectively remove all subtotals instances associated with each subtotal
      • isTypeActive

        boolean isTypeActive​(int subTotalType)
        Returns whether the collection contains an object of the given subtotal type which is active (meaning that it is turned on for some axis or unit or group by).
        Parameters:
        subTotalType - The type of subtotal to check for, from EnumDSSXMLMetricType.
        Returns:
        True if the subtotal type is active, false otherwise.
      • size

        int size()
        Returns the number of items in the collection.
        Returns:
        The number of items in the collection.
      • isEmpty

        boolean isEmpty()
        Returns whether the collection is empty.
        Returns:
        True if the collection is empty, false otherwise.
      • elements

        java.util.Enumeration elements()
        Returns a java.util.Enumeration containing the objects in the collections.
        Returns:
        A java.util.Enumeration containing the WebTemplateSubtotal objects in the collection.
      • activateAxisSubtotal

        WebTemplateSubtotal activateAxisSubtotal​(int index,
                                                 int subtotalStyle,
                                                 int axisIndex)
                                          throws java.lang.IllegalArgumentException
        Adds an axis or 'By Position' subtotal of the given type, with the given style, to the given axis.
        Parameters:
        index - The index of the subtotal in the collection.
        subtotalStyle - The style of subtotal to add, from EnumDSSXMLSubtotalStyle.
        axisIndex - The axis to add the subtotal to, from EnumDSSXMLAxisName.
        Returns:
        WebTemplateSubtotal A reference to the subtotal that was just added
        Throws:
        java.lang.IllegalArgumentException - Thrown if one of the parameters is invalid.
      • activateUnitSubtotal

        WebTemplateSubtotal activateUnitSubtotal​(int index,
                                                 WebObjectInfo[] units)
                                          throws java.lang.IllegalArgumentException
        Adds a Unit or 'Across Level' subtotal of the given type across the given set of template units.
        Parameters:
        index - The index of the subtotal in the collection.
        units - Array of WebObjectInfo objects across which to add the subtotal.
        Returns:
        WebTemplateSubtotal A reference to the subtotal that was just added
        Throws:
        java.lang.IllegalArgumentException - Thrown if one of the parameters are invalid.
      • activateGroupBySubtotal

        WebTemplateSubtotal activateGroupBySubtotal​(int index,
                                                    WebObjectInfo[][] units)
                                             throws java.lang.IllegalArgumentException
        Adds a 'Group by' subtotal of the given type, grouped by the units defined in the array of units.
        Parameters:
        index - The index of the subtotal in the collection.
        units - Array of array of template units.
        Returns:
        WebTemplateSubtotal A reference to the subtotal that was just added
        Throws:
        java.lang.IllegalArgumentException
      • setSubtotalsPosition

        void setSubtotalsPosition​(int axis,
                                  int position)
        Sets the subtotals position property for the given axis, from EnumDSSXMLSubtotalsPosition
        Parameters:
        axis - The axis for which the subtotal position is requested, from EnumDSSXMLAxisName
        position - The subtotals position property for the axis
      • getActiveSubtotals

        java.util.Enumeration getActiveSubtotals()
        Returns an enumeration or collection of WebTemplateSubtotal objects that are active for the report.
        Returns:
        An enumeration or collection of 'active' WebTemplateSubtotal objects