ITabHyperlink.Action

Syntax

Action: String;

Description

The Action property determines the action to be executed when a hyperlink is activated.

Comments

The property value depends on the type of action determined in the ActionType property:

Action Property value
Open file Path and name of the file that will open, for example, "C:\Image.jpg".

Comment. It is supported only in the desktop application.

Open link URL that should be opened, for example, "https://www.example.com".
Open report sheet Address of activated sheet, for example. "=Sheet2".
Show cell range Address of the cell, range or composite range, on which positioning is executed. If the address is not in the visible area, the page is scrolled to show the range in the center of the area. The example:
"=A10"
"=D0:F5"
"=a0:b3;d0:f3"
Show object in screen center Sheet name and identifier of the object located on the sheet in the following format: "#Sheet!Object". For example: "#Sheet2!PrxChart1".
Open repository object Identifier of the object with the '@' prefix, for example, "@STD_DIM".
Open repository object with sending of parameters Identifier of the object with the '@' prefix and the list of parameter values. Object parameters are sent in round brackets as follows: <parameter identifier>=<parameter value >, and are separated with a semicolon. The parameter can take single or multiple value. Multiple value is specified in square brackets as an array.
The example of single parameter values:
"@STD_DIM(P_STRING=a;P_INT=1;P_FLOAT=0.01;P_DATE=09.02.2021 00:00:00)"
The example of multiple parameter values:
"@STD_DIM(P_STRING=[a,b];P_INT=[1,2];P_FLOAT=[0.01,0.02];P_DATE=[09.02.2021 00:00:00,10.02.2021 00:00:00])"
Run procedure/function As a value, specify the executed Fore method and/or JS function in special format. If Fore method and JS function are specified in the desktop application, further behavior depends on where the table is worked with:
  • If work is executed in the desktop application - Fore function is executed by hyperlink.
  • If work is executed in the web application - JavaScript function is executed by hyperlink. Fore method and JS function are not called at the same time.
If only JS function is specified, the hyperlink will work only in the web application.
Call format specified in the Action property:
  • To call Fore function: fore:<identifier of unit/form/assembly.method name>.
  • To call JS function: javascript:<function name()>.
The fore/javascript prefixes and angle brackets are mandatory. If it is required to specify Fore method and JS function at the same time, values should be separated via a semicolon. The Fore method should be implemented in the global namespace of the specified unit/form/assembly.
The example of value of the Action property for calling various functions:
  • fore:<M_MODULE.TestFunction>.
  • javascript:<TestJSFunction()>.
  • fore:<M_MODULE.TestFunction>;javascript:<TestJSFunction()>.
Executed methods/functions can have parameters. Parameter values are specified in parentheses via a comma, for example, fore:<M_MODULE.TestParamFunction(100, "A")>.

Comment. Specifying URLs to table elements for sending values to method/function is not supported.

For details about signature and connection of JS function to regular report or data entry form see the Connecting Custom JS-Function section.

Example

Executing the example requires that the repository contains a regular report with the REGULAR_REPORT identifier. The report contains several sheets, among which there is a sheet named Data.

Add links to the Metabase, Report and Tab system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    Tab: ITabSheet;
    Range: ITabRange;
    Hyperlink: ITabHyperlink;
Begin
    MB := MetabaseClass.Active;
    Report := MB.ItemById("REGULAR_REPORT").Edit As IPrxReport;
    Tab := (Report.ActiveSheet As IPrxTable).TabSheet;
    Range := Tab.ParseCell("A0");
    Hyperlink := Range.Style.Hyperlink;
    Hyperlink.Action := "=Data";
    Hyperlink.ActionType := TabHyperlinkActionType.GoToSheet;
    Hyperlink.Enable := TriState.OnOption;
    Hyperlink.SeparateLinkText := TriState.OnOption;
    Hyperlink.Text := "Go to data";
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a hyperlink is created in the A0 cell of regular report active sheet. This hyperlink is used to go to the Data sheet.

See also:

ITabHyperlink