Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS: How to display a hyperlink in sql services reporting

I'm using SSRS for 2008 R2 to display some data-generated reports. In my database table, I have a cell called Remarks. It usually contains links to software defects. The cell is nvarchar(max) and I've added links such as http://stackoverflow.com. However, when the report is displayed, the link is not clickable as expected. What do I need to do make the link clickable? Many thanks for any help. J.

like image 272
bearaman Avatar asked Feb 14 '13 15:02

bearaman


People also ask

How do I hyperlink in SSRS report?

To add a hyperlink and...In report design view, right-click the text box, image, or chart to which you want to add a link and then click Properties. In the Properties dialog box, click the Action tab. Read on for information about your options.

How do you create a hyperlink in SQL query?

You can do it using string concatenation. Note that this just return the url as a string; to show it as a hyperlink you have to add the appropriate html tags, but that should probably be done in the presentation layer of your application.


2 Answers

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

  1. Right-click the field in design view, select Text Box Properties. Report Builder Field Right-Click

  2. Select the Action pane, select the Go to URL radio button.

  3. In the Select URL textbox, enter the field value expression. Field Action URL


URL Embedded in Text

  1. Double-click the field in design view, then right-click Create Placeholder. Report Builder Placeholder

  2. In the Value textbox, enter the field value expression containing HTML tags.

  3. Under Markup Type, check the HTML - Interpret tags as styles radio button. Report Builder Placeholder options

  4. Verify link is displayed when report is run. Report Builder Placeholder Output


like image 75
Bryan Avatar answered Sep 19 '22 05:09

Bryan


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

like image 38
glenn garson Avatar answered Sep 18 '22 05:09

glenn garson