AX1774

ReapplyCurrentViews function

Toggles a Boolean value in a target cell and then reapplies the current views. This function can be used to simulate expand/collapse behavior for groupings in a sheet, using views. The view tags can use a formula that references the target cell, so that the rows or columns are visible when True and hidden when False (or vice versa).

For example:

  • The file opens with a view applied, and this view hides the rows in the block.

  • The first time a user double-clicks the cell with the function, the value in the target cell is set to TRUE. The file is recalculated, which causes the formulas that determine the view tags to resolve as something like "Show". The current view is then reapplied, which causes the rows to become visible.

  • The next time the user double-clicks the cell with the function, the value in the target cell is set to FALSE. The file is recalculated, which causes the formulas that determine the view tags to resolve as something like [Hiderow] (depending on which type of view is being used). The current view is then reapplied, which causes the rows to become hidden.

This cycle can be repeated as needed so that the user can show and hide the rows on demand.

The function could also be used to hide and show a set of columns, or make any changes to views based on the toggled value of the target cell.

Syntax

ReapplyCurrentViews("DisplayText","TargetCell")

Parameter Description
DisplayText

The display text for the cell containing the function. For example, the text could be something like "Double-click to view details."

The DisplayText displays as normal text in the cell. If you want the text to appear like a hyperlink on a web page, you must manually apply the font formatting to the cell.

TargetCell

The target cell in which to place the toggled Boolean value. If the target cell contains no value, the first execution of the function sets the value to TRUE. If the target cell already contains the value TRUE, the next execution of the function sets the value to FALSE (and vice versa).

NOTE: Remember to place the target cell location in quotation marks, such as "C25". If you omit the quotation marks and use just C25, then the entry is interpreted as a cell reference within the function—meaning that Axiom Software attempts to read the target cell location from the cell reference. If C25 is empty or contains content other than a cell location, the function returns an error when it is double-clicked.

All non-numeric entries must be placed in double quotation marks, unless you are using cell references to reference the text held in another cell.

Remarks

  • The Axiom Double-Click setting does not need to be enabled for the sheet in order to use ReapplyCurrentViews.

  • ReapplyCurrentViews is not for use in Axiom forms; it is only for use in spreadsheet Axiom files.

  • ReapplyCurrentViews is a non-volatile function.

Examples

The following example screenshots illustrate how this function can be used. In this example, the file has a defined Initial Dynamic View that is applied on open, and this view hides the detail rows. Each section has been set up with a ReapplyCurrentViews function.

When a user double-clicks the cell with the function, the value of the target cell is toggled—in this case, cell E89 goes from True to False. The file is calculated so that any formulas referencing this cell are now updated, and then views are reapplied. In this example, the rows in this section are now shown because the formula is resolved to no longer display [HideRow] tags.

If the user double-clicks the cell again, the target cell is toggled back to True and the formulas resolve to display [HideRow] tags—resulting in the rows being hidden when the views are reapplied.