Answered by:
adding link field to results in report builder

Question
-
Is it possible to have a field which contains a link to the build results?
closl
Tuesday, March 19, 2013 3:22 PM
Answers
-
Yes. Links can be done in 2 ways (that I know of) in SSRS.
- 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. - 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.
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.
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.
"You will find a fortune, though it will not be the one you seek." - Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek.Tuesday, March 19, 2013 4:11 PM - 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:
All replies
-
Yes. Links can be done in 2 ways (that I know of) in SSRS.
- 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. - 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.
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.
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.
"You will find a fortune, though it will not be the one you seek." - Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek.Tuesday, March 19, 2013 4:11 PM - 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:
-
Thank you!!
closl
Tuesday, March 19, 2013 5:10 PM