How to open URL in SSRS report in webpart to new window
Asked Answered
P

2

13

I have created a report that I will embed in Sharepoint 2007 via a webpart using a report viewer. This works well and looks rather nice, however in the report I have a text field whose action is "Go To URL".

When I click on the link within the webpart the link goes to the URL but it opens the URL within the webpart. Kind of ugly. There doesnt seem to be any additional capabilities/properties of the text box in the report other than setting the URL.

How can I make the link/webpart open the URL in a new tab or window? Other than telling the user to right click the link and "Open in a new tab"....

Pylos answered 17/6, 2013 at 13:51 Comment(0)
S
33

Have you tried using javascript and window.open to open a new window in the Go To URL action of the textbox? For example:

="javascript:void(window.open('http://myserver/mypath/myasppage.html', '_blank'))"

Check out this article for more info.

Socle answered 17/6, 2013 at 14:26 Comment(1)
Thanks! Im relatively new to creating SSRS reports so... Appreciate the feedback greatly!Pylos
T
12

Adding to Christine's answer, if Fields values are required, something like this can be done:

="javascript:void(window.open('https://myserver/mypath/mypage.aspx?myID=" & Fields!myID.Value & "','_blank'))"
Tojo answered 25/5, 2018 at 11:59 Comment(1)
This is a good solution, but is it possible to open this new tab without switching to it automatically?Arguseyed

© 2022 - 2024 — McMap. All rights reserved.