Action: String;
Action: string;
The Action property determines the action to be performed, when a hyperlink is activated.
Action | Property value example |
Open file | "C:\Image.jpg" The specified file will open. |
Open link | "http://www.example.com" The specified address will open. |
Open report sheet | "=Sheet2" Moving to the specified report sheet will be performed. |
Show cell range | "=a0:b3;d0:f3" Positioning on the specified range will be performed. |
Show object in the centre of the screen | "#Sheet2!PrxChart1" Positioning on a diagram on the second report sheet will be performed. |
Open repository object | "@Dim" An object with «Dim» identifier will open. |
Run procedure/function | Depending on the file where the macro is implemented the path to the macro in this property is specified in the different ways:
JS function and Fore function can be specified in macros together. JS function will be executed only in viewing web application and Fore function will be executed on viewing in the Foresight Analytics Platform:
Implementation of user macros in the .NET units and .Net forms of the repository is to be performed within a class. A macro is to be a static procedure or function. "OBJ34114.MyFunction" The MyFunction function will be executed, that is contained in the unit with the OBJ34114 identifier. |
In this example we suppose that an object Report of the type IPrxReport exists.
Add links to the Report, Tab system assemblies.
Sub UserProc;
Var
Rep: IPrxReport;
Tab: ITabSheet;
Range: ITabRange;
Hyperlink: ITabHyperlink;
Begin
Tab := Rep.ActiveSheet.Table;
Range := Tab.Cell(0, 0);
Hyperlink := Range.Style.Hyperlink;
Hyperlink.Action := "=Sheet2";
Hyperlink.Enable := TriState.OnOption;
Hyperlink.SeparateLinkText := TriState.OnOption;
Hyperlink.Text := "Go to Sheet2";
End Sub UserProc;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.ForeSystem;
Private Sub UserProc();
Var
Rep: IPrxReport;
Tab: ITabSheet;
Range: ITabRange;
Hyperlink: ITabHyperlink;
Begin
Tab := Rep.ActiveSheet.Table;
Range := Tab.Cell[0, 0];
Hyperlink := Range.Style.Hyperlink;
Hyperlink.Action := "=Sheet2";
Hyperlink.Enable := TriState.tsOnOption;
Hyperlink.SeparateLinkText := TriState.tsOnOption;
Hyperlink.Text := "Go to Sheet2";
End Sub
As a result, the «A0» cell of the regular report a hyperlink with the text "Go to Sheet2" will be created, clicking on which will result in going to "Sheet2".
See also: