How Do I Use a Link Tag?
Suppose you want a piece of content, such as an image or a bit of text, to contain a link to a website. If the URL is static (i.e. it doesn't change), you can simply create the hyperlink in the template via the appropriate Word, Excel or PowerPoint command.
But what if the URL is stored in your data source and is dynamic? You need a way to call upon that up-to-date URL when output is generated from your Report Template without having to manually check the link each time.
This is where the Link Tag comes in. When output is generated from the Report Template, the Link Tag goes to the data source, retrieves the desired URL, and inserts the link into the output. To use the Link Tag, you simply put the Link Tag before, and the EndLink Tag after, the content to be linked.
In this article we'll step through an example of using Link and EndLink Tags.
For more details about the Link and EndLink Tags, see the Link and EndLink Tag Reference.
Every Link Tag must have a corresponding EndLink Tag.
Open a new Word document, then connect to our public LinksDemo database in our mssql.windward.net data source. If you're unfamiliar with connecting to a SQL Server data source, see How Do I Connect to a Microsoft SQL Server Data Source.
Click on the Tags button in the AutoTag ribbon, then select the Link Tag:
Double-click on the Link Tag to bring up the Tag Editor, then drag and drop the URL from the Data Tree Pane onto the Query Pane. Then save the Link Tag.
Now move your cursor next to the Link Tag, click on the Tags button in the AutoTag ribbon, and select an Out Tag:
Double-click on the Out Tag to bring up the Tag Editor. In the Query Pane of the Out Tag, enter the name of the link (which is displayed in the output), with a leading single quote. Save the Out Tag.
To make the link appear distinctive in your output, underline the Out Tag and change its color using Word text formatting.
Next, move your cursor next to the Out Tag, click on the Tags button in the AutoTag ribbon, then select the EndLink Tag:
Finally, generate output to see your link: