Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rendering HTML Link in SSRS is omitting the target attribute

I am using SQL reporting services 2008 R2, and in one of my reports I am using the Placeholder text to render an html link (anchor) to open a page in another window, The expression text is as below:

="<a target='_top' href=""http://www.google.com""  >Print</a>"

however, when the report is rendered in the browser, the target='_blank' is not there, as if the SSRS renderer is ignoring it.

I tried before to use JavaScript to open in a new window, but that did not work on the client machine, because I am hosting the SSRS reports in an Iframe hosted in another web application, and both the web application and the SSRS report server are on different domains. This issue can't be solved using JavaScript according to this link

So the question is why is the SSRS renderer ignoring my target="_blank" attribute

like image 252
Hassan Mokdad Avatar asked Nov 30 '22 00:11

Hassan Mokdad


1 Answers

I have done this before with javascript. On the "Action" tab of your link's Textbox properties, select "Go to URL". Then enter this script in the "Select URL" expression:

javascript:void(window.open('http://www.google.com', '_blank'))

If you need the URL to be passed by your dataset, you can do this:

="javascript:void(window.open('" & Fields!YourURL.Value & "', '_blank'))"
like image 171
Ron Smith Avatar answered Dec 18 '22 20:12

Ron Smith