AX1005
Using hyperlinks in Formatted Grids
You can use the HREF content tag within a Grid data source to present hyperlinks to other files or web pages. The HREF syntax has no effect within the source file itself, but when the file is viewed as an Axiom form, the HREF tag will be resolved as a clickable hyperlink.
NOTE: Other means of creating clickable hypertext within a spreadsheet—such as using Excel's Hyperlink function, or Axiom Software's GetDocument function—will not work when the file is viewed as an Axiom form. The text will not render as clickable, and the target file or URL will not open.
Example HREF tags in a Grid data source
Rendering of example tags in an Axiom form
Content tag syntax for hyperlinks
The syntax for the HREF content tag is as follows:
[Href=URL; Text=DisplayText; UseNewWindow=True/False; Tooltip=Text; ColumnStyle=StyleName; Columns=Number;]
Parameters can be listed in any order. Optional parameters can be omitted.
To create the tag, you can manually type it within a cell, or you can use the Data Source Assistant / Tag Editor. For more information, see Creating and editing content tags in Formatted Grids.
Parameter | Description |
---|---|
HREF |
The URL to the target file or web page. See the following section for more information on how to generate a URL to a file within the Axiom database. When using the Data Source Assistant / Tag Editor, you can use the [...] button to select a file in the Axiom file system. If you browse to a file rather than specifying a URL, then the HREF parameter will contain a document reference instead of a URL. This document reference will be dynamically converted to a URL when the form is rendered. Alternatively, you can use a bracketed cell reference to read the URL from the referenced cell. This approach is useful if you want to dynamically determine the URL, because then the formula can be in the referenced cell instead needing to construct the tag using a formula. For more information, see Referencing cells in content tag parameters. |
Text |
Optional. The display text for the hyperlink. If omitted, the URL will be the display text. You can define the text within the tag directly, or you can use a bracketed cell reference to read the placeholder text from another cell. This approach is useful if you want to dynamically determine the text, because then the formula can be in the referenced cell instead needing to construct the tag using a formula. For more information, see Referencing cells in content tag parameters. NOTE: If desired, you can use a symbol instead of display text for the hyperlink. In this case, the user can double-click the symbol to open the specified URL. To do this, replace the Text parameter with a Symbol parameter. For more information on symbol syntax, see Using symbols in Formatted Grids. |
Tooltip |
Optional. Specifies tooltip text to display when a user hovers the cursor over the cell contents. Alternatively, you can use a bracketed cell reference to read the tooltip text from the referenced cell. This approach is useful if you want to dynamically determine the text, because then the formula can be in the referenced cell instead needing to construct the tag using a formula. For more information, see Referencing cells in content tag parameters. |
UseNewWindow |
Optional. Specifies whether the URL target will open in a new browser window (True/False). If omitted, the default is False, meaning the target will open in the same browser window (replacing the current window contents). File tabs opened within the Desktop ClientGeneral term for using either the Excel Client or the Windows Client, both of which are installed to the user's desktop. are treated the same as browser windows for this purpose. This parameter does not apply and should not be specified for URL targets that do not open in a browser window, such as when linking to spreadsheet Axiom files or plan file attachments. In this case, the parameter should always be omitted or set to False. |
Columns |
Optional. Specifies how many columns the cell contents will span in the grid. If this parameter is omitted or set to 1, then content generated by the tag will only span the current column. If you want the content to span multiple columns, enter a number such as 2 to span 2 columns. The column span extends to the right. NOTE: The row and column styles used in the grid impact how the column span displays. For example, if the content in the starting column is left-aligned and does not naturally exceed the width of the starting column, then the spanned columns will simply be blank because no content is extending to those columns. However, if the content is long enough to extend out of the starting column, or if the content has external borders (such as a text box), or if the content is center-aligned or right-aligned, then content will display in the spanned columns. |
ColumnStyle |
Optional. Specifies one or more column styles to apply to the current cell. The specified styles override the current column styles set by the Enter one or more valid column style names, separated by commas. If you are using the Data Source Assistant / Tag Editor, you can click the [...] button to open the Choose Styles dialog and select from available styles. The available styles depend on the skin specified for the form. For more information, see Using row and column styles with Formatted Grids. Alternatively, you can use a bracketed cell reference to read the style from the referenced cell. This approach is useful if you want to dynamically determine the style, because then the formula can be in the referenced cell instead needing to construct the tag using a formula. For more information, see Referencing cells in content tag parameters. |
For example:
[Href=http://www.axiomepm.com;Text=Axiom Software;UseNewWindow=True]
This example creates a hyperlink to the Axiom Software website using the display text "Axiom Software". The hyperlink will open in a new window.
NOTE: Alternatively, you can use the functions GetFormDocumentLinkTag and GetFormResourceLinkTag to generate the HREF tag for you, given parameters such as the document ID and the display text. These functions can only be used to generate HREF tags to form-enabled documents and to plan file attachments. These functions return basic HREF syntax that cannot be modified to include optional features (like using a symbol instead display text, or defining colors in the tag).
Hyperlink behavior notes
Hyperlinks generated by HREF tags are displayed in blue font with no underline by default. If desired, you can use the UNDERLINED style to apply an underline to the text. Styles can be applied on an individual tag basis by using the ColumnStyle parameter, or at the column level by using a [ColumnStyle]
row.
Generating a URL to a file in the Axiom file system
If you want to hyperlink to a file in the Axiom file system, you need to be able to provide a URL to that document. The following functions can be used to generate the URL, depending on what type of file you want to open using the hyperlink:
File to Open | Function |
---|---|
Axiom form |
Use GetFormDocumentURL to generate a URL to another Axiom form, given a file path or a document ID. Various methods are available to return the file path or the document ID of a particular file, and/or to generate a list of files and IDs.
When using GetFormDocumentURL, you can optionally apply a sheet filter to the target form, and/or optionally pass variable values to the target form. |
Web report |
Use GetWebReportDocumentURL to generate a URL to a web report, given a file path or a document ID. You can look up the ID or file path of any individual file in Axiom Explorer, or you can query the Axiom.FileSystemInfo table to get a list of files, paths, and IDs. |
Plan file attachment |
Use GetFormResourceURL to generate a URL to a plan file attachment, given a file path or a document ID. The document IDs for plan file attachments can be returned by querying the Axiom.PlanFileAttachments table. File paths can be returned by querying the Axiom.FileSystemInfo table. |
Other Axiom file |
Use GetDocumentHyperlink to generate a URL to an Axiom file, given a file path or a document ID. URLs generated using GetDocumentHyperlink will open the specified file within the Desktop ClientGeneral term for using either the Excel Client or the Windows Client, both of which are installed to the user's desktop.. Therefore linking to regular Axiom files from within an Axiom form should only be done when the form is intended to be viewed within the Desktop Client (or in a browser on client machines where the users have access to the Desktop Client). You can look up the ID or file path of any individual file in Axiom Explorer, or you can query the Axiom.FileSystemInfo table to get a list of files, paths, and IDs. |
When using the Tag Editor to create the HREF tag, you can browse to any file within the Axiom file system. This places a document reference within the tag, which will be dynamically converted to a URL when the form is rendered. This approach may be useful to link to a specific, static file in the Axiom file system.
The following examples use a formula to generate the URL for the hyperlink:
="[Href="&GetFormResourceURL(G23)&";Text=Open Attachment"&H23&"]"
This example uses GetFormResourceURL to generate a URL to a plan file attachment, where the document ID or file path is located in cell G23. The display text incorporates the name of the attachment from cell H23. The UseNewWindow parameter is omitted because it is inapplicable to plan file attachments, which do not open in browser windows.
="[Href="&GetFormDocumentURL(G23)&";Text=Open Plan File for "&H23&";UseNewWindow=True]"
This example uses GetFormDocumentURL to generate a URL to a form-enabled plan file, where the document ID or file path is located in cell G23. The display text incorporates the name of the associated plan code from cell H23 (something like "Dept 42000"). The plan file form will open in a new window.