Embed a Hyperlink Into a Cell in a Report


Create an HTML link that displays a value that can be clicked to open a web page that corresponds to the value displayed. There are two types of links that can be embedded into a report: a URL and an HTML code snippet.

URL Method

Using the URL is ungainly, but it can export to Excel. The URL is constructed in a variable to create a fully qualified (UNC or HTTP) path to the document to be opened.

Example

<My URL>="\\{Server name}}\{Share & folder Path}\" &<Control No>&".PDF"

HTML Method

An HTML code snippet makes a more visually pleasing hyperlink and uses less space on the report. However, it does not export to Excel properly.

  1. Format the cell where the link will be placed to read as HTML.

    <htmlentity></htmlentity>
  2. Build a variable using the URL above to create the HTML code.

    <My HTML>="<A href=" & Char(34) & <My URL> & Char(34) & ">" & <Control No> & "</A>"

    The Char(34) functions are used to place quotation marks into the string.