How to open URL in SSRS report in webpart to new window

微笑、不失礼 提交于 2019-12-07 03:58:41

问题


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"....


回答1:


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.




回答2:


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'))"


来源:https://stackoverflow.com/questions/17149244/how-to-open-url-in-ssrs-report-in-webpart-to-new-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!