java.lang.Object | ||||
↳ | com.microstrategy.web.transform.AbstractTransform | |||
↳ | com.microstrategy.web.transform.AbstractLayoutTransform | |||
↳ | com.microstrategy.web.app.transforms.AbstractAppTransform | |||
↳ | com.microstrategy.web.app.transforms.PageByTransform |
The Page-by Transform generates the HTML for both, the page-by axis of a report and the group-by section of a document.
This class transforms a PageByBean
. This bean is the one that
encapsulates the differences at the WebApi
level between reports and
documents.
This transform can be used in either design or view mode. Design mode renders the list of units and allows end users to add/remove/pivot/sort them using drag and drop, context menus or simply buttons. In view mode, the transform also renders a dropdown list with the page-by elements from which end-users can filter the displayed data.
The default output of the PageByTransform is divided into two methods renderTitle(MarkupOutput)
and renderBody(MarkupOutput)
. The first includes the title of the dialog, a summary section with the current
selections and close and help buttons. The body just renders the list of page-by units
with their corresponding elements (if in view mode).
This Transform implements LayoutTransform
, therefore the output generated
can be controlled and modified using an external configuration xml file.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | PageByTransform.Context | Extends AbstractAppTransform.Context by providing a link to the
current WebObjectInfo . |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected String | _removeOptionString | ||||||||||
protected FormalParameter | advancedDrillingContextMenuDisplay | It is used in the transform to specify whether to show the advanced drilling options in the editor or context menu. | |||||||||
protected FormalParameter | groupContextMenuDrillPathsByType | It is used in the transform to specify whether to show the set names and drill paths names alphabetically sorted. | |||||||||
public FormalParameter | helpTopic | Indicates the help topic for the help page of the editor. | |||||||||
public FormalParameter | helpType | Indicates the type of help topic this editor uses. | |||||||||
protected FormalParameter | isAutoSubmitEnabled | This is the flag used in the transform to specify whether to enable auto-submit functionality. | |||||||||
protected FormalParameter | isContextMenuEnabled |
This field is deprecated.
To customize context-menus use the xml-definition specified by contextMenus
|
|||||||||
protected FormalParameter | isDragAndDropEnabled | This is the flag used in the transform to specify whether to enable drag and drop functionality. | |||||||||
protected FormalParameter | isEditable | This flag indicates the page by attributes can be arranged or removed from the panel. | |||||||||
protected FormalParameter | isSummaryWhenClosedEnabled | This flag indicates the Transform to render the summary section, even if the even is closed. | |||||||||
protected FormalParameter | showDrillAdvanced | It is used in the transform to specify whether to allow advanced drilling. | |||||||||
protected FormalParameter | showDrillDownOnly | It is used in the transform to specify whether to allow drilling to the child only. | |||||||||
protected FormalParameter | showDrillMetric | It is used in the transform to specify whether to allow drilling on metrics. | |||||||||
protected FormalParameter | showDrillPathSetNamesSubMenuAtTopLevel | It is used in the transform to specify whether to show the set names submenu for drilling at the top level (or at a lower depth). | |||||||||
protected FormalParameter | showDrillRMC | It is used in the transform to specify whether to show Right Mouse Click menu for drill. | |||||||||
protected FormalParameter | showDrillRMCMetric | It is used in the transform to specify whether to show Right Mouse Click menu for drill for metrics. | |||||||||
protected FormalParameter | sortSetNamesAndDrillPaths | It is used in the transform to specify whether to show the set names and drill paths names alphabetically sorted. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PageByTransform() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Map |
getAttributesBody()
Returns a map (name/value pairs) with attributes and their
corresponding values used with the
<div> tag enclosing the
body. | ||||||||||
Map |
getAttributesTitle()
Returns a map (name/value pairs) with attributes and their
corresponding values used with the
<div> tag enclosing the
title. | ||||||||||
Map |
getAttributesUnit(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their
corresponding values used with the
<div> tag enclosing a
single page-by unit. | ||||||||||
String |
getDescription()
Returns a textual description of the transform.
| ||||||||||
String |
getEditorTitle()
Returns the title for the editor.
| ||||||||||
PageByBean |
getPageByBean()
Returns the
PageByBean being transformed. | ||||||||||
Class |
getSupportedBeanType()
Overrides AbstractAppTransform#getSupportedBeanType.
| ||||||||||
boolean | hasFakedUnits() | ||||||||||
void |
initializeCss()
Initialize the css classes to be used by this transform.
| ||||||||||
void |
initializeImages()
Initialize the images to be used by this transform.
| ||||||||||
void |
initializeTransform(Transformable data)
This method initialize the private and protected fields of the transform, such as width and height. | ||||||||||
boolean |
isContextMenusEnabled()
Indicates whether context-menus are enabled for this Transform.
| ||||||||||
boolean |
isDesignMode()
Indicates to the transform that it should render its
content for design mode (in this case, some functionality
might be disabled or different).
| ||||||||||
boolean |
isListEmpty()
Returns
true is the page-by units list is empty. | ||||||||||
void |
renderAlias(MarkupOutput out, PageByUnit unit)
Renders the unit alias.
| ||||||||||
void |
renderBody(MarkupOutput out)
Renders the editor's body. | ||||||||||
void |
renderCloseButton(MarkupOutput out)
If the dialog can be closed (that is, the
canClose method
returns true) it will render the close button. | ||||||||||
void |
renderEditorTitle(MarkupOutput out)
Renders the title for the editor, just converts the editor title
to upper case and appends ":"
| ||||||||||
void |
renderElementList(MarkupOutput out, PageByElementList list)
Renders a single element list (that is, the dropdown that allows the end-user to select the current element). | ||||||||||
void |
renderElements(MarkupOutput out, PageByUnit unit)
Renders the elements for the given unit. | ||||||||||
void |
renderEmptyList(MarkupOutput out)
This method is used to render the body when the list of units is empty.
| ||||||||||
void |
renderFakedUnits(MarkupOutput out, PageByUnitReportFaked unit)
This method generates the fake page-by units for the attributes that are not on the template.
| ||||||||||
void |
renderHelpButton(MarkupOutput out)
Renders a button with the link to the help section with the corresponding
help topic.
| ||||||||||
void |
renderList(MarkupOutput out)
Renders all pageby units (by calling for each one renderUnit).
| ||||||||||
void |
renderPivotButtons(MarkupOutput out, PageByUnit unit)
Renders pivot buttons (if available) for the given unit.
| ||||||||||
void |
renderSelectedElement(MarkupOutput out, PageByElementList list)
Renders a single selected element label | ||||||||||
void |
renderSelectedElementLabel(MarkupOutput out, PageByUnit unit)
Renders the selected element label for the given unit. | ||||||||||
void |
renderSortButtons(MarkupOutput out, PageByUnit unit)
Renders sort buttons (if available) for the given unit.
| ||||||||||
void |
renderSubmitButton(MarkupOutput out)
Renders the submit button for the element list.
| ||||||||||
void |
renderSummary(MarkupOutput out)
Renders the summary of the current selections.
| ||||||||||
void |
renderTitle(MarkupOutput out)
Renders the dialog's title.
| ||||||||||
void |
renderUnit(MarkupOutput out, PageByUnit unit)
Renders a single unit.
| ||||||||||
void |
transformForRequestSuccessful(MarkupOutput out)
Main entry point for this transform. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
canClose()
Indicates the Transform whether it can be closed.
| ||||||||||
WebEvent |
getChangeSelectedElementEvent()
Returns the event used by the Transform to change the currently selected element.
| ||||||||||
WebEvent |
getCloseEvent()
Returns the event used to close the Transform.
| ||||||||||
Map |
getContextMenuAttributes(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their
corresponding values necessary for context-menus used with
the <div> tag enclosing a
single page-by unit.
| ||||||||||
WebEvent |
getDeletetEvent(PageByUnit unit)
Returns the event used by the Trasnform to delete a pageby unit from the working-set definition. | ||||||||||
Map |
getDragAndDropAttributes(PageByUnit unit)
Returns a map (name/value pairs) with attributes and their
corresponding values necessary for drand and drop
used with the <div> tag enclosing a
single page-by unit.
| ||||||||||
Editor |
getEditor()
Returns an initialized
Editor instance, this instance is used by
the Transform as a helper object to render the help and close buttons. | ||||||||||
WebEvent |
getGenericEvent()
In HTML mode, all actions (sort, pivot, change element) need to be summited
in the same <FORM> tag, therefore the event submitted needs
to support all of these and execution the correct action based
on an argument.
| ||||||||||
WebEvent |
getHelpEvent()
This method is deprecated.
No replacement.
| ||||||||||
WebEvent |
getMainEvent()
This will return the event that the main form should use.
| ||||||||||
WebEvent |
getPivotEvent(PageByUnit unit, String action)
Returns the event used by the Trasnform to pivot a pageby unit.
| ||||||||||
WebEvent |
getRemoveEvent(PageByUnit unit)
Returns the event used by the Trasnform to remove a pageby unit.
| ||||||||||
String |
getRemoveTooltip()
Gets the tooltip for the remove image.
| ||||||||||
String |
getScriptClass()
This method overwrites the default implementation by determining which script class to use
based on properties of the target report, not by what was defined as value of the formal
parameter
| ||||||||||
WebEvent |
getSortEvent(PageByUnit unit)
Returns the event used by the Trasnform to sort a pageby unit.
| ||||||||||
boolean |
isAutoSubmitEnabled()
Method that indicates if auto-submit is enabled for this transform.
| ||||||||||
boolean |
isContextMenuEnabled()
This method is deprecated.
Use
isContextMenusEnabled() .
| ||||||||||
boolean |
isDragAndDropEnabled()
Method that indicates if drag and drop is enabled for this transform.
| ||||||||||
boolean |
isOpen()
Extends
isOpen by returning true even if the
PageByBean is closed whenever all the following conditions
are met:
| ||||||||||
boolean |
isTargetRW()
Indicates if the target bean should be treated as a
RWBean (document). | ||||||||||
boolean |
isTargetReport()
Indicates if the target bean should be treated as a
ReportBean . | ||||||||||
TransformContext |
newContext()
Creates a new instance of a TransformContext.
| ||||||||||
void |
renderDeleteImage(MarkupOutput out, PageByUnit unit)
Renders the image to delete a unit.
| ||||||||||
void |
renderJavascript(MarkupOutput out)
Method that will render all output necessary for client-side
manipulations using javascript
| ||||||||||
void |
renderPivotImage(MarkupOutput out, PageByUnit unit, String cmdvl, String css, String src, String alt)
Renders the image to pivot a unit.
| ||||||||||
void |
renderPivotImage(MarkupOutput out, PageByUnit unit, String cmdvl, String css, String alt)
Renders the image to pivot a unit.
| ||||||||||
void |
renderRemoveImage(MarkupOutput out, PageByUnit unit)
Renders the image to remove a unit from the page-by section.
| ||||||||||
void |
renderSortImage(MarkupOutput out, PageByUnit unit, String css, String src, String title)
Renders the image to sort a unit.
| ||||||||||
void |
renderSortImage(MarkupOutput out, PageByUnit unit, String css, String title)
Renders the image to sort a unit.
| ||||||||||
boolean |
shouldDisplay()
Determines whether the transform should render itself or not.
| ||||||||||
boolean | showFakedUnits() | ||||||||||
boolean |
showRemoveFromReport()
This method is deprecated.
This method is not used by Transform anymore and will be removed from future versions of the product.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
It is used in the transform to specify whether to show the advanced drilling options in the editor or context menu.
Allowed Values: PreferencesDrillTransform.ADVANCED_DRILLING_RMC_DISPLAY_DEFAULT = "1"
ADVANCED_DRILLING_RMC_DISPLAY_SUBMENU = "2"
It is used in the transform to specify whether to show the set names and drill paths names alphabetically sorted.
Allowed Values: TRUE/FALSE.
This is the flag used in the transform to specify whether to enable auto-submit functionality.
With this functionality, the page-by element selection is automatically submitted using javascript as soon as
the element is selected by the end user.
Noticed, though, that even if this parameter is true, this functionality might be disabled if the
user doesn't have enough privileges, if it's not DHTML mode, or based on the WebFeatureAutoPageBy Feature.
Allowed Values: TRUE/FALSE.
This field is deprecated.
To customize context-menus use the xml-definition specified by contextMenus
This is the flag used in the transform to specify whether to enable context menu functionality.
Noticed, though, that even if this parameter is true, this functionality might be disabled if the
user doesn't have enough privileges or if it's not DHTML mode.
Allowed Values: TRUE/FALSE.
This is the flag used in the transform to specify whether to enable drag and drop functionality.
Noticed, though, that even if this parameter is true, this functionality might be disabled if the
user doesn't have enough privileges or if it's not DHTML mode.
Allowed Values: TRUE/FALSE.
This flag indicates the page by attributes can be arranged or removed from the panel.
Allowed Values: TRUE/FALSE.
This flag indicates the Transform to render the summary section, even if the even is closed.
When this happens, the Transform isOpen returns true even if the underlying PageByBean is closed, and
invokes the renderSummary method.
Allowed Values: TRUE/FALSE.
It is used in the transform to specify whether to allow advanced drilling.
Allowed Values: TRUE/FALSE.
It is used in the transform to specify whether to allow drilling to the child only.
Allowed Values: TRUE/FALSE.
It is used in the transform to specify whether to allow drilling on metrics.
Allowed Values: TRUE/FALSE.
It is used in the transform to specify whether to show the set names submenu for drilling at the top level (or at a lower depth).
Allowed Values: TRUE/FALSE.
It is used in the transform to specify whether to show Right Mouse Click menu for drill.
Allowed Values: TRUE/FALSE.
It is used in the transform to specify whether to show Right Mouse Click menu for drill for metrics.
Allowed Values: TRUE/FALSE.
It is used in the transform to specify whether to show the set names and drill paths names alphabetically sorted.
Allowed Values: TRUE/FALSE.
Returns a map (name/value pairs) with attributes and their
corresponding values used with the <div>
tag enclosing the
body. These attributes are used for javascript and formatting.
Returns a map (name/value pairs) with attributes and their
corresponding values used with the <div>
tag enclosing the
title. These attributes are used for javascript and formatting.
Returns a map (name/value pairs) with attributes and their
corresponding values used with the <div>
tag enclosing a
single page-by unit. These attributes are used for javascript and formatting and
include information for drand and drop and context menus.
Returns a textual description of the transform.
Returns the title for the editor. For documents it returns "Grouping", for reports it retursn "Page-by"
Returns the PageByBean
being transformed.
PageByBean
being Transformed.
Overrides AbstractAppTransform#getSupportedBeanType. Returns:
PageByBean.class
Initialize the css classes to be used by this transform.
Initialize the images to be used by this transform.
This method initialize the private and protected fields of the transform, such as
width and height.
It also invokes the initializeWebComponent
, initializeImages
and initializeCss
methods.
transform
method. Transforms which
would like to invoke other methods in this instance directly (for example, to invoke
some render methods), need first to call this method to
guarantee that the Transform is ready to generate output.data | the bean to transform. |
---|
Indicates whether context-menus are enabled for this Transform. By default
context-menus are enabled only if the contextMenus
formal parameter
has been set.
true
if context-menus are enabled in this Transform.Indicates to the transform that it should render its content for design mode (in this case, some functionality might be disabled or different).
true
if the bean is in design mode.
Returns true
is the page-by units list is empty.
true
if the page-by units list is empty.
Renders the unit alias.
out | where the output gets rendered. |
---|---|
unit | PageByUnit being rendered. |
Renders the editor's body. This method will call renderEmptyList(MarkupOutput)
or renderList(MarkupOutput)
accordingly.
Tag div = getTagsFactory().newDivTag(); div.setCssClass(_cssBody); div.setStyle("position: relative;"); div.setAttributes(getAttributesBody()); if (isListEmpty()) { renderEmptyList(div.getContent()); } else { renderList(div.getContent()); } div.render(out);
out | where the output gets rendered. |
---|
If the dialog can be closed (that is, the canClose
method
returns true) it will render the close button.
out | where the output gets rendered. |
---|
Renders the title for the editor, just converts the editor title to upper case and appends ":"
out | where the output gets rendered. |
---|
Renders a single element list (that is, the dropdown that allows the end-user to select the current element).
By default the list is rendered inside a drop-down box.
However if the user doesn't have the DssXmlPrivilegesWebSwitchPageByElements
privilege, it will not
render a drop-down but just a label with
the current selection.
out | where the output gets rendered. |
---|---|
list | PageByElementList to render. |
Renders the elements for the given unit. This is the dropdown that allows the users to select the element that will filter the data currently displayed.
Normally, a PageByUnit has a single
PageByElementList
, therefore it is rendered with a single dropdown,
but in some cases (for example, when the PageByUnit
corresponds
to a dimension) it might have more than one. This method will call
renderElementList(MarkupOutput, PageByElementList)
for every necessary drop down.
out | where the output gets rendered. |
---|---|
unit | PageByUnit being rendered. |
This method is used to render the body when the list of units is empty. It just adds the message "none" to the output.
out | where the output gets rendered. |
---|
This method generates the fake page-by units for the attributes that are not on the template.
Renders a button with the link to the help section with the corresponding help topic.
out | where the output gets rendered. |
---|
Renders all pageby units (by calling for each one renderUnit).
out | where the output gets rendered. |
---|
Renders pivot buttons (if available) for the given unit.
out | where the output gets rendered. |
---|---|
unit | PageByUnit being rendered. |
Renders a single selected element label
out | where the output gets rendered. |
---|---|
list | PageByElementList to render. |
Renders the selected element label for the given unit.
out | where the output gets rendered. |
---|---|
unit | PageByUnit being rendered. |
Renders sort buttons (if available) for the given unit.
out | where the output gets rendered. |
---|---|
unit | PageByUnit being rendered. |
Renders the submit button for the element list. Notice however nothing will be rendered if the list is empty, or if the autosubmit is enabled.
out | where the output gets rendered. |
---|
Renders the summary of the current selections.
If there are no units it just appends "none".
If there are units but it's design mode, since no selections are available
it returns an empty list.
out | where the output gets rendered. |
---|
Renders the dialog's title. This includes:
Tag div = getTagsFactory().newDivTag(); Tag spanTitle = div.addChild("span"); Tag spanButtons = div.addChild("span"); Tag spanSummary = div.addChild("span"); div.setCssClass("titleBar"); div.setAttributes(getAttributesTitle()); spanTitle.setCssClass("title"); spanButtons.setCssClass("buttons"); spanSummary.setCssClass("summary"); renderEditorTitle(spanTitle.getContent()); renderHelpButton(spanButtons.getContent()); renderCloseButton(spanButtons.getContent()); renderSummary(spanSummary.getContent()); div.render(out);
out | where the output gets rendered. |
---|
Renders a single unit. For each unit this method will:
Tag span = getTagsFactory().newSpanTag(); span.setCssClass("gby"); span.setAttributes(getAttributesUnit(unit)); renderSortButtons(span.getContent(), unit); renderAlias(span.getContent(), unit); renderElements(span.getContent(), unit); renderPivotButtons(span.getContent(), unit); span.render(out);
out | where the output gets rendered. |
---|---|
unit | PageByUnit being rendered. |
Main entry point for this transform. This is the method responsible of generating the HTML output.
If a layout-xml is associated throught the style catalog this method will delegate execution to theLayoutParser
by calling renderLayout(MarkupOutput)
otherwise it
will call renderTitle(MarkupOutput)
and renderBody(MarkupOutput)
. Then it calls renderJavascript(MarkupOutput)
.out | where the output is generated. |
---|
Indicates the Transform whether it can be closed. Mainly used to decide whether to show the close button or not. There is the case where this needs to be open, even if the bean is closed (e.g. when we're showing the summary but not the dropdowns), in this case the bean is already closed so we don't want to show the button. The other case is in design mode for reports, here by design the dialog cannot be closed.
Returns the event used by the Transform to change the currently selected element.
EnumPageByBeanEvents.WebEventPageBySelectElement
.
Returns the event used to close the Transform.
EnumPageByBeanEvents.WebEventShowBean
.
Returns a map (name/value pairs) with attributes and their
corresponding values necessary for context-menus used with
the <div> tag enclosing a
single page-by unit.
This method also builds these menus.
Returns the event used by the Trasnform to delete a pageby unit from the working-set definition. When you simply remove an object from the page-by, the object can still be used in other parts of the report/document definition. When you deleted from the working-set, though, the report definition changes, the unit is not available anymore and the report/document gets re-executed with the new definition.
unit | PageByUnit to pivot |
---|
Returns a map (name/value pairs) with attributes and their corresponding values necessary for drand and drop used with the <div> tag enclosing a single page-by unit.
Returns an initialized Editor
instance, this instance is used by
the Transform as a helper object to render the help and close buttons.
In HTML mode, all actions (sort, pivot, change element) need to be summited in the same <FORM> tag, therefore the event submitted needs to support all of these and execution the correct action based on an argument. This is the event used by the Transform for this case.
EnumPageByBeanEvents.WebEventPageByGeneric
.
This method is deprecated.
No replacement.
Returns the event used to open the online help in the corresponding section.
EnumServletEvents.WebEventOpenHelp
.This will return the event that the main form should use. In DHTML it returns the changeSelectedElement event. In HTML mode is returns the generic event.
Returns the event used by the Trasnform to pivot a pageby unit. The action
argument decides the type of pivot (left, right, to columns, etc).
unit | PageByUnit to pivot |
---|
Returns the event used by the Trasnform to remove a pageby unit. Notice that this event only removes the unit from the page-by section, but the unit is still available for manipulations in the working set definition.
unit | PageByUnit to pivot |
---|
Gets the tooltip for the remove image. This depends on privileges and the target type
This method overwrites the default implementation by determining which script class to use based on properties of the target report, not by what was defined as value of the formal parameter
Returns the event used by the Trasnform to sort a pageby unit.
unit | PageByUnit to sort |
---|
Method that indicates if auto-submit is enabled for this transform.
true
if available.
This method is deprecated.
Use isContextMenusEnabled()
.
Method that indicates if context-menus are enabled for this transform.
true
if available.Method that indicates if drag and drop is enabled for this transform.
true
if available.
Extends isOpen
by returning true
even if the
PageByBean
is closed whenever all the following conditions
are met:
isSummaryWhenClosedEnabled
FormalParameter is true.
true
if the dialog should be open.
Indicates if the target bean should be treated as a RWBean
(document).
PageByBean
is a RWBean
.
Indicates if the target bean should be treated as a ReportBean
.
PageByBean
is a ReportBean
.
Creates a new instance of a TransformContext. It's used by the getContext method the first time is invoked. Transforms who require to include extra information in the context should create their own TransformContext implementation (possibly a subclass of AppTransformContext) and returns a new instance in this method.
Renders the image to delete a unit. Deleting actually removes the unit from the working set and may trigger new SQL execution. By default this si only called if removing the unit from the page-by section is not available.
Method that will render all output necessary for client-side manipulations using javascript
out | where the output is generated. |
---|
Renders the image to pivot a unit. In HTML mode it adds the link for the pivot event. This method is used to render any of the posible pivot actions on a unit. Src will only be used in cases of accessibility support.
Renders the image to pivot a unit. In HTML mode it adds the link for the pivot event. This method is used to render any of the posible pivot actions on a unit.
Renders the image to remove a unit from the page-by section. In HTML mode it adds the link for the remove event.
Renders the image to sort a unit. In HTML mode it adds the link for the sort event. Src will only be used in cases of accessibility support.
Renders the image to sort a unit. In HTML mode it adds the link for the sort event.
Determines whether the transform should render itself or not. Returns the result of !isIFrameRequest()
or the result
of the hasChanged()
method.
This method is deprecated.
This method is not used by Transform anymore and will be removed from future versions of the product.
Indicates whether this unit can be removed from the report.
Any time you remove the last template unit from a REPORT (not just grid),
you'll get the 'template unit is empty' error when executing it. If you're already
in view mode (e.g. the report has been executed), when removing this unit the user will
get the error, therefore we want to prevent it, therefore we will not allow
users to remove if its the las unit in the template.