Search code examples
urlreporting-servicesserviceactionreporting

How to open a database stored URL from Reporting Services Report in a new tab


I have a reporting services report I am creating from an oracle database using reporting services in Visual studio 2012. The report shows the record's data as well as the attachments associated with the record. The attachment's URL is stored in a database column called URL_link.

If I just put =Fields!URL_LINK.Value in Actions in the text box properties the link works just fine but it opens the link in the same window. This means the user has to go back to the report and run the parameters again to pull up the report they were looking at. I want to be able to code it so when the user clicks on the link the attachment opens in a new window. I tried this but it doesn't work.

="javascript:void(window.open('First(Fields!URL_LINK.Value)','_blank'))" opens a new tab but it doesn't open the url in the database field URL_LINK.


Solution

  • You need to actually build the link as a string, at the moment your Action is trying to open a website with the address First(Fields!URL_LINK.Value) rather than the value held in that field.

    Change it to the below and it should work:

    ="javascript:void(window.open('" & First(Fields!URL_LINK.Value) & "','_blank'))"