SSRS: How to display a hyperlink in sql services reporting
Two approaches, the first assumes data is pre-formatted as a URL (e.g. https://www.google.com
). The second assumes the URL is contained within some other text (e.g. 'This is a link to Google').
URL Only
Right-click the field in design view, select
Text Box Properties
.Select the
Action
pane, select theGo to URL
radio button.In the
Select URL
textbox, enter the field value expression.
URL Embedded in Text
Double-click the field in design view, then right-click
Create Placeholder
.In the
Value
textbox, enter the field value expression containing HTML tags.Under
Markup Type
, check theHTML - Interpret tags as styles
radio button.Verify link is displayed when report is run.
How to create a text box in the title area that is a hyperlink (opens in another window)
1] Drag Text box to title area from Toolbar to the design surface
2] Then from the 'Report Data' pane on the left side, drag any field from the dataset into the text box {this is to create a 'placeholder' rather than a plain 'textbox'
3] Right click on the field, in the textbox, go to 'Placeholder Properties'
4] in the action Pane, of the 'Placeholder Properties' window, click 'Go to URL', then click the fx, i.e. expression button, and paste the following into the expression:
="javascript:void(window.open('http://172.15.189.14:64444/ElectronicForms.aspx','_blank'))"
click [ok] to close the expression window
5] Go to the 'General' tab, in the 'Placeholder Properties' widow. The Value field will be populated with the name of the field that you dragged into the text box, in step2, delete the name of the field. Then click the fx, expression button, and type the following into the expression window:
="Click for Help"
Then click [ok] to close the expression window
Then click [ok] to close the 'PlaceHolder Properties' window