com.microstrategy.web.objects.WebTemplate |
WebTemplate represents a template, which is a first class object. The WebTemplate object and
its subordinate objects can be used to manipulate the template units of a template.
Note that a template obtained from WebReportInstance
cannot be called populate()
, unlike all other
WebObjectInfo
-derived objects. Also, to get access to the template units or properties in
a template from WebReportInstance
, report needs to
be executed first, before calling getTemplate()
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract WebTemplateUnit |
add(WebObjectInfo objectInfo, int toAxis, int toPosition)
This method will take the given object, and add a
WebTemplateUnit pointing
to the given object at the given axis and position within the template. | ||||||||||
abstract WebTemplateUnit |
add(WebTemplateUnit templateUnit, int toAxis, int toPosition)
Moves the given template unit, which should exist on the current template, from it's current
position to the given position on the template.
| ||||||||||
abstract WebTemplateUnit | add(WebObjectInfo objectInfo, int toAxis, int toPosition, boolean copyFormatting) | ||||||||||
abstract WebTemplateUnit |
addMetrics(int toAxis, int toPosition)
This method will add or move the
WebTemplateMetrics collection to the given axis
and position within the template. | ||||||||||
abstract void |
clearCurrentElements()
Clears the current element.
| ||||||||||
abstract void |
clearTemplate()
Clear the current template
| ||||||||||
abstract boolean |
contains(WebObjectInfo object)
Returns true if the given object is on the template, false otherwise.
| ||||||||||
abstract WebTemplateUnit |
findTemplateUnit(int key)
Searches the template for the
WebTemplateUnit object with the given key. | ||||||||||
abstract WebAxis |
getAxis(int index)
Returns the
WebAxis object with the given index. | ||||||||||
abstract WebAxis |
getColumns()
Returns the
WebAxis object which refers to the column axis of the template. | ||||||||||
abstract Iterator<WebTemplateMetric> |
getDisabledMetrics()
Get the collection iterator of the disable metrics
| ||||||||||
abstract WebTemplateFormatContainer |
getFormatContainer()
Returns the Format Container on this template, which contains the 4
WebFormat objects. | ||||||||||
abstract WebAxis |
getPages()
Returns the
WebAxis object which refers to the page axis of the template. | ||||||||||
abstract WebAxis |
getRows()
Returns the
WebAxis object which refers to the row axis of the template. | ||||||||||
abstract WebTemplateMetricSubtotals |
getSubtotals(WebMetric metric)
This method is deprecated.
Subtotals are no longer defined at the template metric level. They are defined at the template level
Please use
getSubtotals() instead.
| ||||||||||
abstract WebTemplateSubtotals |
getSubtotals()
Returns the
WebTemplateSubtotals object, which represents a collection of
subtotals that are available for a given report. | ||||||||||
abstract SimpleList |
getTemplateAttributes()
Returns a read-only
SimpleList of WebTemplateAttribute objects, which correspond
to every attribute on this template. | ||||||||||
abstract WebTemplateAttributes |
getTemplateAttributesCollection()
Returns a read-only {WebTemplateAttributes collection} of
WebTemplateAttribute objects, which correspond
to every attribute on this template. | ||||||||||
abstract WebTemplateMetrics |
getTemplateMetrics()
If the
WebTemplateMetrics collection exists
on the template, then it will be returned as-is. | ||||||||||
abstract WebTemplateUnit |
getTemplateUnit(WebObjectInfo objectInfo)
Returns the
WebTemplateUnit corresponding to the given object on the template. | ||||||||||
abstract WebTemplateUnit |
getTemplateUnit(int axis, int position)
Returns the
WebTemplateUnit at the given axis and position on the template. | ||||||||||
abstract SimpleList |
getUnits()
Returns a read-only
SimpleList of WebTemplateUnit objects, which correspond
to every template unit on this template. | ||||||||||
abstract boolean |
hasAttributes()
Returns true if the template contains an attributes collection
| ||||||||||
abstract boolean |
hasMetrics()
Returns true if the template contains a metrics collection, in other words, an axis which
contains a
WebTemplateUnit which refers to a WebTemplateMetrics object. | ||||||||||
abstract boolean |
hasSubtotals()
Return whether there is any subtotal definition exist for this report.
| ||||||||||
abstract boolean |
isShowBanding()
Return the setting of whether showing banding.
| ||||||||||
abstract boolean |
isShowSubtotals()
Return the setting of whether showing subtotals.
| ||||||||||
abstract void |
remove(WebObjectInfo objectInfo, boolean isDisableOnly)
Finds the given
WebObjectInfo object, and if it is found, removes it from
the template. | ||||||||||
abstract void |
remove(WebTemplateUnit templateUnit)
Searches for the given
WebTemplateUnit object within the template, and removes it. | ||||||||||
abstract void |
remove(WebObjectInfo objectInfo)
Finds the given
WebObjectInfo object, and if it is found, removes it from
the template. | ||||||||||
abstract void |
remove(WebTemplateUnit templateUnit, boolean isDisableOnly)
Searches for the given
WebTemplateUnit object within the template, and removes it. | ||||||||||
abstract void |
removeMetrics()
Finds the metrics collection on the template and if it is found, removes it from
the template.
| ||||||||||
abstract void |
removeMetrics(boolean isDisableOnly)
Finds the metrics collection on the template and if it is found, removes it from
the template.
| ||||||||||
abstract void |
showBanding(boolean show)
Sets the setting to show or hide banding.
| ||||||||||
abstract void |
showSubtotals(boolean show)
Sets the setting to show or hide subtotals.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
This method will take the given object, and add a WebTemplateUnit
pointing
to the given object at the given axis and position within the template. If the object
already exists in another template unit already on the template, then it will be moved(pivoted)
to the given position.
objectInfo | A WebObjectInfo object, representing the object to be placed on the template. |
---|---|
toAxis | The axis index (values from EnumDSSXMLAxisName ) of the WebAxis ,
which the object should be placed upon. |
toPosition | The position within the given axis to place the given object. |
WebTemplateUnit
object added to(or moved on, if it already exists) the template.UnsupportedOperationException | Signals that the template is marked read-only. |
---|---|
IllegalArgumentException | Signals that the axis or position cannot be found, or
the WebObjectInfo object is of a type which cannot be added to a template.
|
Moves the given template unit, which should exist on the current template, from it's current position to the given position on the template.
templateUnit | The WebTemplateUnit object to search for on the template. |
---|---|
toAxis | The axis index (values from EnumDSSXMLAxisName ) of the axis to move the unit to. |
toPosition | The position within the given axis to move the unit to. |
UnsupportedOperationException | Thrown if the collection is read-only. |
---|---|
IllegalArgumentException | Thrown if the template unit does not exist on the template, or if the given axis and position do not exist on the template. |
IllegalArgumentException | |
---|---|
UnsupportedOperationException |
This method will add or move the WebTemplateMetrics
collection to the given axis
and position within the template. If there is no metrics collection on the template, then
it will be created anew in the given position. If the metrics collection
already exists in another template unit already on the template, then it will be moved(pivoted)
to the given position.
toAxis | The axis index (values from EnumDSSXMLAxisName ) of the WebAxis ,
which the metrics collection should reside upon. |
---|---|
toPosition | The position within the given axis to place the metrics collection. |
WebTemplateUnit
object containing the metrics collection.UnsupportedOperationException | Signals that the template is marked read-only. |
---|---|
IllegalArgumentException | Signals that the axis or position cannot be found on the template. |
Clears the current element.
Clear the current template
Returns true if the given object is on the template, false otherwise.
object | The object to find on the template. |
---|
Searches the template for the WebTemplateUnit
object with the given key.
key | The key of the object to search for. |
---|
WebTemplateUnit
object corresponding to the given key.UnsupportedOperationException | Thrown if the template is marked as read-only. |
---|---|
IllegalArgumentException | Thrown if the key cannot be found on the template. |
Returns the WebAxis
object with the given index. This index is one-based, and
comes from EnumDSSXMLAxisName
.
index | The index of the axis to return. |
---|
WebAxis
object which corresponds to the given index.IllegalArgumentException | Thrown if no axis by the given index exists. |
---|
Returns the WebAxis
object which refers to the column axis of the template.
Get the collection iterator of the disable metrics
WebTemplateMetrics
Iterator.
Returns the WebAxis
object which refers to the page axis of the template.
Returns the WebAxis
object which refers to the row axis of the template.
This method is deprecated.
Subtotals are no longer defined at the template metric level. They are defined at the template level
Please use getSubtotals()
instead.
Returns the WebTemplateMetricSubtotals
object corresponding to the given metric.
metric | A WebMetric object corresponding to a metric on the template. |
---|
WebTemplateMetricSubtotals
object describing the subtotals set on the metric.IllegalArgumentException | Thrown if the given metric is not found on the template. |
---|
Returns the WebTemplateSubtotals
object, which represents a collection of
subtotals that are available for a given report.
WebTemplateSubtotals
object describing the subtotals available for
the templateReturns a read-only SimpleList
of WebTemplateAttribute
objects, which correspond
to every attribute on this template.
SimpleList
containing all attributes on the template.
Returns a read-only {WebTemplateAttributes collection} of WebTemplateAttribute
objects, which correspond
to every attribute on this template.
WebTemplateAttributes
containing all attributes on the template.
If the WebTemplateMetrics
collection exists
on the template, then it will be returned as-is. If it does not exist, then it will be created
at the end of the column axis, and the new WebTemplateMetrics
collection will be
returned.
WebTemplateMetrics
collection.
Returns the WebTemplateUnit
corresponding to the given object on the template.
objectInfo | The object to search for on the template. |
---|
WebTemplateUnit
object corresponding to the given object on the template.UnsupportedOperationException | Thrown if the template is read-only. |
---|---|
IllegalArgumentException | Thrown if no item exists at the given axis and position on the template. |
Returns the WebTemplateUnit
at the given axis and position on the template.
axis | The index (values from EnumDSSXMLAxisName ) of the axis of the template unit. |
---|---|
position | The position of the unit on the given axis. |
WebTemplateUnit
object at the given place on the template.UnsupportedOperationException | Thrown if the template is read-only. |
---|---|
IllegalArgumentException | Thrown if no item exists at the given axis and position on the template. |
Returns a read-only SimpleList
of WebTemplateUnit
objects, which correspond
to every template unit on this template.
SimpleList
containing all template unit on this template.
Returns true if the template contains an attributes collection
Returns true if the template contains a metrics collection, in other words, an axis which
contains a WebTemplateUnit
which refers to a WebTemplateMetrics
object.
Return whether there is any subtotal definition exist for this report. In other words, this returns whether there are any active subtotals for the report.
true
if there is any subtotal defined for any metric. otherwise
false
returned.Return the setting of whether showing banding.
Return the setting of whether showing subtotals.
Finds the given WebObjectInfo
object, and if it is found, removes it from
the template.
objectInfo | The object to remove from the template. |
---|---|
isDisableOnly | Indicate if it is a 'disable from grid' or 'remove from grid' for RWD |
UnsupportedOperationException | Signals that the template is marked read-only. |
---|
Searches for the given WebTemplateUnit
object within the template, and removes it.
templateUnit | The WebTemplateUnit object to remove from the template. |
---|
UnsupportedOperationException | Thrown if the template is marked read-only. |
---|---|
IllegalArgumentException | Thrown if the template unit does not exist on the template. |
Finds the given WebObjectInfo
object, and if it is found, removes it from
the template.
objectInfo | The object to remove from the template. |
---|
UnsupportedOperationException | Signals that the template is marked read-only. |
---|
Searches for the given WebTemplateUnit
object within the template, and removes it.
templateUnit | The WebTemplateUnit object to remove from the template. |
---|---|
isDisableOnly | Indicate if it is a 'disable from grid' or 'remove from grid' for RWD |
UnsupportedOperationException | Thrown if the template is marked read-only. |
---|---|
IllegalArgumentException | Thrown if the template unit does not exist on the template. |
Finds the metrics collection on the template and if it is found, removes it from the template.
UnsupportedOperationException | Signals that the template is marked read-only or that the metrics collection was not found. |
---|
Finds the metrics collection on the template and if it is found, removes it from the template.
isDisableOnly | Indicate if it is a 'disable from grid' or 'remove from grid' for RWD |
---|
UnsupportedOperationException | Signals that the template is marked read-only or that the metrics collection was not found. |
---|
Sets the setting to show or hide banding.
show | Set this parameter to true to show the banding, set this paramter to false to hide the banding. |
---|
Sets the setting to show or hide subtotals.
show | Set this parameter to true to show the subtotals, set this parameter to false to hide the subtotals. |
---|