1

My client requires a report that produces a comma separated list of files in one column of a grid. I know I can use a FOR XML Path in my query to yield these results. However, the client wants to be able to click on an individual value in that CSV and be taken to a link for that element in the list. For example, the column in the report would look like:

1.jpg, 2.jpg, 3.jpg

He needs the ability to click on the 2.jpg, and go to that actual file. I know I can put in an action for the entire field to go to one URL, but can I narrow that action down to a specific part of the CSV list?

user1873604
  • 163
  • 1
  • 1
  • 12

2 Answers2

2

You can use placeholders to embed hyperlinks in comma delimited text, you'll need to wrap each value with an anchor tag and href. See the URL Embedded in Text section of my earlier answer an example.

SQLFiddle of sample code for adding markup. It's ugly in SQL but works.

Community
  • 1
  • 1
Bryan
  • 17,112
  • 7
  • 57
  • 80
  • Thanks for the reply. I was able to use the example in SQL Fiddle to get a return that has the HTML markup. I also added the placeholder, as per the second example. However, i get a string returned that has the markup, but is not clickable. Am I missing a step? – user1873604 May 22 '13 at 20:32
  • @user1873604 What about step 3, setting HTML tags to be interpreted as styles? If you did that, please update your post with the HTML and a screenshot of the placeholder properties window for the report field. – Bryan May 22 '13 at 20:34
  • Thanks, I did do that step. Unfortunately, this is on a restricted network, so I am unable to send a screen shot. My computer that faces the internet is not allowed to have development tools, so I cannot recreate it there, either – user1873604 May 23 '13 at 13:03
  • The HTML look like it is properly formatted. When I copy out an HTML string from the report (between commas) and paste it into excel, it gives me a valid link. It's just not recognizing the HTML in SSRS for some reason. – user1873604 May 23 '13 at 13:32
  • This works, but had to do some modifications to make it work with multiple URLs – user1873604 May 23 '13 at 18:27
0

I came up with a workable solution. The problem seems to lie in the fact that there are multiple URLs in the list. If i only return a single URL, it works fine. so, instead of a CS list, I return one at a time and use a matrix to group the other fields.

user1873604
  • 163
  • 1
  • 1
  • 12