Package com.microstrategy.web.objects
Interface WebTemplateSubtotal
-
public interface WebTemplateSubtotal
The WebTemplateSubtotal interface represents a subtotal of a single type within theWebTemplateSubtotals
collection. This interface allows the user to gather information about and turn on/off the subtotal.- Since:
- MicroStrategy Web 9.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebSubtotalInstance
createInstance(int type)
Creates a WebSubtotalInstance of the appropriate type and associates it to the subtotal.void
deActivate()
Inactivates theWebTemplateSubtotal
object.WebMetric
getDefinition()
Returns the definition of a custom subtotal.int
getIndex()
Returns the index of the subtotal within theWebTemplateSubtotals
collection.WebSubtotalInstance
getInstance()
Returns the WebSubtotalInstance associated with the subtotal.java.lang.String
getName()
Returns the name of the subtotal.WebTemplateSubtotal
getSubtotalForMetric(WebMetric metric)
Returns the subtotal set for a given metric.int
getTemplateSubtotalType()
Returns the subtotal type of the subtotal.int
getType()
Returns the type of subtotal.boolean
isActive()
Returns whether the subtotal is active.
-
-
-
Method Detail
-
getType
int getType()
Returns the type of subtotal.- Returns:
- A value from
EnumDSSXMLMetricType
, corresponding to the subtotal type.
-
getDefinition
WebMetric getDefinition() throws java.lang.UnsupportedOperationException
Returns the definition of a custom subtotal. A custom subtotal is a subtotal whose type is EnumDSSXMLMetricType.DssXmlMetricSubtotal.- Returns:
- The metric which the custom subtotal refers to. This will be an object of
type
WebMetric
. - Throws:
java.lang.UnsupportedOperationException
- Thrown if the subtotal is not a custom subtotal, that is, its subtotal type is not EnumDSSXMLMetricType.DssXmlMetricSubtotal.
-
isActive
boolean isActive()
Returns whether the subtotal is active. A subtotal is active if it is turned on for the report. The subtotal may be turned on by position, across level or grouped by template units for the report.- Returns:
- Whether the subtotal is active.
-
getIndex
int getIndex()
Returns the index of the subtotal within theWebTemplateSubtotals
collection.- Returns:
- The key of the subtotal object.
-
getInstance
WebSubtotalInstance getInstance()
Returns the WebSubtotalInstance associated with the subtotal. The WebSubtotalInstance can then be used to get more information about how the subtotal has been defined, like whether the subtotal is set by position or by level (units) or by group by etc. If the subtotal has not been turned on, then it will return null- Returns:
- A
WebSubtotalInstance
object that holds information about how the subtotal is active
-
createInstance
WebSubtotalInstance createInstance(int type)
Creates a WebSubtotalInstance of the appropriate type and associates it to the subtotal. If the subtotal already has a subtotal instance of different type associated with it, this call will clear the original subtotal instance, create a new WebSubtotalInstance and return it. Otherwise it will just return the current subtotal instance.- Parameters:
type
- type of subtotal instance fromEnumSubtotalInstanceType
-
deActivate
void deActivate()
Inactivates theWebTemplateSubtotal
object. This will clear the WebSubtotalInstance associated with the subtotal and generate the appropriate delta
-
getName
java.lang.String getName()
Returns the name of the subtotal. Example, Average, Total etc.- Returns:
- String that represents the name of the subtotal object
-
getTemplateSubtotalType
int getTemplateSubtotalType()
Returns the subtotal type of the subtotal. This value indicates whether a subtotal is a definition subtotal or a list subtotal. A list subtotal is a Desktop created 'Custom' subtotal. This value is fromEnumDSSXMLTemplateSubtotalType
-
getSubtotalForMetric
WebTemplateSubtotal getSubtotalForMetric(WebMetric metric)
Returns the subtotal set for a given metric. Mainly used for 'List Subtotals' or 'Custom subtotals' where you can define the subtotal function (average, sum, minimum etc) to be used for each metric on the template. For a 'definition' subtotal, this method will return itself.- Parameters:
metric
- Metric whose subtotal is required.- Returns:
- WebTemplateSubtotal used to define the subtotal for the given metric
-
-