SSRS: How to display a hyperlink in sql services reporting

痞子三分冷 提交于 2019-12-28 12:28:41

问题


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.


回答1:


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.

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

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


URL Embedded in Text

  1. Double-click the field in design view, then right-click Create 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.

  4. Verify link is displayed when report is run.





回答2:


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

|improve this answer

来源:https://stackoverflow.com/questions/14878752/ssrs-how-to-display-a-hyperlink-in-sql-services-reporting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!