AX1311

Defining row views in a sheet

You can define row views in a sheet, to allow users to toggle certain rows as hidden or shown.

For example, you may have multiple row "blocks" within a sheet (such as for different regions or departments), and you want users to be able to show or hide these row blocks individually. You can set up these rows with row view tags, and then users can specify which row blocks are currently visible in the sheet by toggling these row view tags off or on.

Row views are additive by default. Unlike sheet views, where the user must switch between one view or another, any number of row views can be active at the same time. Continuing the previous example, if a user wants to see the row blocks for both Region West and Region East, they can choose to enable both of those row views at the same time. However, if desired it is also possible to configure a RowView tag so that only one row view within that control column can be active at a time.

Row views are defined by creating the following tags in the sheet:

  • A RowView tag to designate the control column for this set of row views. The tag can also be used to define an overall group name for the row views, and to optionally enforce single selection of row views.

  • Row tags to mark rows to be shown or hidden, and to define the row view names. These tags are placed in the control column.

Row view tag summary
Tag Type Tag Syntax

Primary tag

[RowView; GroupName; SelectionType]

Row tags

[Row; ViewName]

Defining the RowView tag in a sheet

To define a set of row views, place the following tag in any cell within the first 500 rows of the sheet. The column where the RowView tag is placed becomes the view control column.

[RowView; GroupName; SelectionType]

The RowView tag uses the following parameters:

Item Description

GroupName

Optional. A top-level group name for all row views defined in this control column.

  • If omitted, then all view names defined in the Row tags will display directly on the Change View menu.

  • If defined, then all view names defined in the Row tags will belong to the group name. The specific behavior of the menu depends on whether the SelectionType is set to Single. For more information, see Configuring view display on the Change View menu.

This name must be unique across all views defined in the sheet, including row views and sheet views.

SelectionType

Optional. Specifies whether row views are additive, or whether only one row view can be active at a time.

  • If omitted, then multiple row views can be active at a time. This is the default behavior.
  • Otherwise, use the keyword Single to specify that only one row view (from this control column) can be active at a time.

NOTE: If you enable single-selection, then you must also define a group name. The column view names affected by the single-selection behavior are displayed underneath the group name, so that the user can understand that selecting one of these items causes the other items in the group to become inactive. The group name should attempt to make this behavior clear—for example, it should say something like "Select a Region to Show" versus "Select Regions to Show."

Examples

[RowView]

This tag simply designates the control column for the row views. The specific names defined in the individual Row tags display directly on the menu.

[RowView;Show Rows]

In this example, a group name has been defined for the tag. This name will display as the first level on the Choose View menu instead of the individual row view names.

[RowView;;Single]

In this example, the text "Single" is used in the third parameter to specify that only one row view (from this control column) can be active at a time. Note that the omitted second parameter must be delimited with an "empty" semicolon.

NOTES:  

  • The primary RowView tag must be located in the first 500 rows of the sheet.

  • RowView tags can be placed within a formula, as long as the starting bracket and identifying tag are present as a whole within the formula. For more information, see Using formulas with Axiom feature tags.

Marking rows to include in row views

Within the view control column, use the following tag to mark each row that you want users to be able to toggle shown or hidden:

[Row; ViewName]

ViewName defines the name that users will select from the Change View menu to toggle this row shown or hidden. The name can also be used to apply a default row view when the file is opened.

Multiple rows in the RowView control column can use the same view name so that those rows are toggled as a unit. However, the name cannot be used in any other view control.

When a row view name is toggled active, rows marked with that name are shown. When a row view name is toggled inactive, rows marked with that name are hidden. Any rows in the control column that are not marked with Row tags are unaffected by the row view.

Example

Rows 5-7 belong to the row view named Section A, and rows 8-10 belong to the row view named Section B. When Section A is active, rows 5-7 are shown; when Section A is inactive, then rows 5-7 are hidden. If both Section A and Section B are active, then rows 5-10 are shown. Row 4 is not marked with a Row tag and therefore is unaffected by the row view.

You can define multiple view names within a single Row tag, separated by commas. For example:

[Row; Section A,All]

This row belongs to both the Section A row view and the All row view. This approach could be used in the Row tags for the previous example so that users have a way to toggle all of the sections visible at once.

Row view behavior

When a file is opened, row views are automatically applied but inactive by default. This means that rows that belong to row views will be hidden (because the row views are not active). If you want to automatically activate one or more row views when the file is opened (so that the rows will be visible), you can use the Initial Dynamic Row Views setting on the Control Sheet. For more information, see Setting the default views for a sheet.

When a row view is made active—whether by default on file open, or by using the Change View command—the following occurs:

  • All rows marked with the designated row view name are shown.

    Exception: If a sheet view is also active in the sheet, and one of the rows belonging to the row view is flagged to be hidden by the sheet view, then the row will be hidden. If a sheet view and row view overlap, the Hide tag in the sheet view takes priority.

  • By default, all other marked rows in the same control column are left as is (shown or hidden). However, if the RowView tag is configured as single-selection, then all other marked rows in the control column are hidden (and their associated row views made inactive).

  • The Freeze Panes settings defined on the Control Sheet (if applicable) are reapplied.

When a row view is made active, the name of the row view is written to the Current Dynamic Row Views cell on the Control Sheet. Multiple active row views are separated by commas. This field is system-maintained and is used to keep track of the current row views so that they can be automatically reapplied after certain file processes (such as after running an Axiom query, or inserting a calc method). If the sheet is not already configured on the Control Sheet, activating a row view will cause it to be.

Multiple row views can be active at a time. All rows belonging to all active row views will be shown (unless a row is hidden by an active sheet view, as described previously).

Using multiple RowView tags

You can define multiple RowView tags in a sheet, to define different sets of row views. You might do this for the following reasons:

  • You want one set of row views to allow multiple-selection, while the other set only allows single selection. Because this is configured on the RowView tag, you must use multiple RowView tags.

  • You want to use different group names for different sets of row views. Because this is configured on the RowView tag, you must use multiple RowView tags.

  • You want a row to belong to more than one row view. However, keep in mind that you may be able to accomplish this more easily by defining multiple row view names within a single Row tag.

Although each individual RowView tag may be configured as multiple-selection or single-selection, if you have multiple RowView tags then these different sets of row views are always additive. Enabling single-selection for a particular RowView tag only controls the row view selections for that particular control column. The user can still select row views from other RowView control columns if they exist, and those rows will be shown even if they would have otherwise been hidden by the single-selection RowView.

NOTE: If you have multiple [RowView] tags in a sheet, make sure that the row view names defined in the [Row] tags are unique within each control column. All rows flagged with the same view name will be treated as belonging to the same view, even if the rows are in different [RowView] control columns.