Javascript 在新的空白窗口中打开报告链接 URL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2143295/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-22 22:56:15  来源:igfitidea点击:

Open report link URL in new blank window

javascriptreporting-serviceshyperlink

提问by user222437

I have dynamic links in my report and when the link is clicked I want it to open in target="_blank".

我的报告中有动态链接,当点击链接时,我希望它以target="_blank".

I have tried the following, but I must be missing a single or double quote somewhere because I am having no luck. The parameters may be throwing me off. For example, I tried these:

我尝试了以下方法,但我一定在某处遗漏了单引号或双引号,因为我运气不好。参数可能会让我失望。例如,我尝试了这些:

="javascript:void(window.open('http://server/folder/filename.aspx?ds='& Parameters!UserName.Value & '&bu=' & Fields!Business_Unit.Value & '&in=' & Fields!Item_No.Value,'_blank'))"

And:

和:

="http://server/folder/filename.aspx?ds="& Parameters!UserName.Value & "&bu="& Fields!Business_Unit.Value & "&in=" & Fields!Item_No.Value &rc:LinkTarget=_blank 

Any suggestions?

有什么建议?

回答by LeBleu

Try this:

尝试这个:

="javascript:void(window.open('http://server/folder/filename.aspx?ds=" & Parameters!UserName.Value & "&bu=" & Fields!Business_Unit.Value & "&in=" & Fields!Item_No.Value & "','_blank'))"

回答by Sukrath Mahajan Mahajan

Use below script in Jump to URL box.

在跳转到 URL 框中使用以下脚本。

="javascript:void(window.open('http://servername/ReportServer/Pages/
   ReportViewer.aspx?/TestFolder/TestReportName&rs:Command=Render&Parameter1=" &
   Parameters!Date1.Value & "&Paramerter2=" & Parameters!dayname.Value & 
   "&Parameter3=" & Fields!Booknumber.Value & "&Parameter4=" & 
   Fields!TopicOrderby.Value & "','_blank'))"

Please double check servername, reportname, parameternames(case sensitive).

请仔细检查servername, reportname, parameternames(区分大小写)。

回答by LudwigHack

Try this on report access URL

在报告访问 URL 上试试这个

&rc:LinkTarget=_blank 

And the option on your report field must look something like ="http://yourURL.com".

您的报告字段上的选项必须类似于="http://yourURL.com".

回答by Tracker1

you need to either use window.open, ortarget

您需要使用 window.open目标

<a href="http://..." target="_blank" />
或者
javascript:void(window.open('http://...'));
javascript:void(window.open('http://...'));

Not both. If you are building your URL, then build it before injecting it into the document.

不是都。如果您正在构建您的 URL,则在将其注入文档之前构建它。

回答by user7015474

This worked for me:

这对我有用:

="javascript:void window.open(" &"'" & Globals!ReportServerUrl & "/Pages/ReportViewer.aspx?" & Globals!ReportFolder & "/SubReportWithMemberInfoUsedByWaiverFinance&rc:Parameters=False&RepParameterSet=50,>64,E," & Fields!YYYYMM.Value & "','_blank')"

回答by user7015474

="javascript:void window.open(" &"'" & Globals!ReportServerUrl & "/Pages/ReportViewer.aspx?" & Globals!ReportFolder & "/SubReportWithMemberInfoUsedByWaiverFinance&rc:Parameters=False&RepParameterSet=50,>64,E," & Fields!YYYYMM.Value & "','_blank')" 

Works well I tested in SSRS 2014 ( That extra parenthesis between VOID and WINDOW is not needed.

效果很好,我在 SSRS 2014 中测试过(不需要 VOID 和 WINDOW 之间的额外括号。

回答by Ehsan Vali

set

HyperlinkTarget="_blank"

of <rsweb:ReportViewer>element in your asp page

<rsweb:ReportViewer>asp 页面中的元素

more description

更多描述