Make a Go to URL action open in new tab

I have set the Go To URL in the Action properties for a textbox in an SSRS report. It works - when the user clicks the link, the current browser window navigates to the URL.

However, we'd like the URL to open up in a new browser tab or a new window. Does anyone know how this can be done in SSRS?

more ▼

asked Mar 07, 2011 at 07:40 AM in Default

avatar image

905 60 64 68

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

The way I do it is like this

 ="javascript:void window.open('http://website.address');"

I think the choice between tab or window is controlled by the browser settings

more ▼

answered Mar 07, 2011 at 07:54 AM

avatar image

Kev Riley ♦♦
66.8k 48 65 81

@Kev Riley Yep, that worked perfectly. Many thanks!

Mar 07, 2011 at 08:18 AM xnl28

Even old posts offer assistance!! Cheers @Kev

Dec 13, 2012 at 05:23 PM sp_lock
(comments are locked)
10|1200 characters needed characters left

you could also use target="_blank" in the a tag as

 < a href="http://mywebsite" target="_blank">URL to show on screen</a>
more ▼

answered May 19, 2011 at 04:33 AM

avatar image

Fatherjack ♦♦
43.8k 79 102 118

This is actually a safer approach. window.open() is considered a popup, so if the url belongs to a different website then popup blocker might block it. If the url is to the same website (just a different page) then popup blocker will always allow it.

target="_blank" attribute of the anchor tag is never subjected to blocking by a popup blocker, so it is safer. This will open a link in new window for older browsers and either new window or new tab for newer browsers depending on the user scoped tabbed browsing settings, namely the when a popup is encountered part of it, which defaults to letting the browser decide how to open popups but has 2 other options to either always use new window or always open new tab. What this means is that the behaviour depends on these settings and if the always use new window option is chosen then there is no way to enforce opening url in new tab, it just happens to work most of the time due to default settings. Interestingly enough these settings affect both popups and anchor tags with target="_blank" attribute the same though technically they are not necessarily the same thing.

May 19, 2011 at 05:47 AM Oleg

This has always puzzled me as the target="_blank" is not part of the HTML standard and therefore on a website and links using it will be in contravention and the site cannot display the Valid HTML logo: alt text


May 19, 2011 at 06:01 AM Fatherjack ♦♦

@Fatherjack This is just sad that target="_blank" is not compliant. To make it compliant they suggest to use rel="external" which is a complete rubbish because it is meaningless by itself and the way to make the links to open in new tab/new window is to combine the useless rel="external" thingy with the javascript adding (guess what) target="_blank" to the anchor at run time. Pretty pathetic :(

May 19, 2011 at 06:28 AM Oleg
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Mar 07, 2011 at 07:40 AM

Seen: 20292 times

Last Updated: Dec 13, 2012 at 05:23 PM

Copyright 2018 Redgate Software. Privacy Policy