다음을 통해 공유


Adding Links in SSRS Reports

***The Request
***Is it possible to have a field which contains a link to the build results?

***The Solution
***Yes. Links can be done in 2 ways (that I know of) in SSRS.

  1. The most common is to set the Action property of a control (textbox, image, etc.). If you right-click the control and open its properties from the context menu, you will see a tab named Action. On the Action tab, select Go to URL then click the fx (expression builder) button next to Select URL textbox. You can use expression build to construct the URL to link to placing fixed portions of the URL in quotes, such as http://www.myurl.com/, and concatenating dynamic elements. I might have a link like:
    ="http://www.myURL.com?"+Parameters!myParam.Label+"="+Parameters!myParam.Value+"&ID="+CStr(Fields.ID.Value)
    Note that I wrapped the ID field value in CStr. This is needed for non-text data since the URL is a string and all of the static parts are in quotes (a string). The + operator takes on a different meaning when working with numbers so using the + operator to join a string with a number results in an error. Casting the non-text elements to string (CStr) resolves the error.
  2. The other method is to format your control content as HTML and inserting HTML into the control. You do the by selecting the content of the control (as shown in the image below), not the control itself.
    http://social.msdn.microsoft.com/Forums/getfile/259956
    In the properties dialog (as shown in image below), select "HTML - Interpret HTML tags as styles". When this flag is set, any HTML (4.0) found in the controls contents will be interpreted as HTML.
    http://social.msdn.microsoft.com/Forums/getfile/259966
    Of course, you can use expression builder to create the control content as I described for creating the Action URL. I will add that using the 2nd method allows you to make only part of the text to be a hyperlink. It also allows you to embed multiple hyperlinks in the same control, each with a different URL.

One last note... Using the 2nd approach (HTML), the hyperlinks will be displayed as you would expect in a web page (typically blue text, underlined). The Action property does not do that. If you want the text to be formatted that way, you need to set the formatting manually

***Related Information
***Forum Post


 

See Also

List of Award Winning TechNet Guru Articles
SQL Server Reporting Services Portal