本文介绍了在新窗口中打开 SSRS URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份报告传递了一个用于访问 salesforce.com 的 ID.我想从 URL 超链接打开 SFDC 作为新页面.但是,我所做的一切似乎都不起作用!

I have a report that passes an id that is used to access salesforce.com. I want to open SFDC as a new page from the URL hyperlink. However, nothing I do seems to be working!

="javascript:void(window.open('https://na5.salesforce.com/& Fields!id.Value,'_blank'))"

="javascript:void(window.open('https://na5.salesforce.com/& Fields!id.Value,'_blank'))"

Fields!id!Value 是正在传递的 SFDC id.我在表达式中尝试此操作无济于事!

Fields!id!Value is the SFDC id that is being passed. I'm trying this in the expression to no avail!

我知道这很简单,但我就是找不到.在此先感谢您的帮助!

I know it is something VERY simple but I'm just not finding it. Thanks in advance for the assistance!

更新!!!

想通了!!!为了记录,语法是:

Figured it out!!! For the record, the syntax is:

="javascript:void(window.open('https://na5.salesforce.com/" & Fields!id.Value & "'))"

="javascript:void(window.open('https://na5.salesforce.com/" & Fields!id.Value & "'))"

推荐答案

根据记录,您的原始语法的问题在于您试图从引用 SSRS 字段到输入字符串,而没有正确地将两者分开.如果您希望之前的语法起作用(不删除目标窗口的名称(即_blank"),您可以这样做:

For the record, the problem with your original syntax was that you were trying to go from referencing an SSRS field to entering a string without separating the two properly. If you wanted your previous syntax to work (without removing the target window's name (i.e., '_blank'), you would do it like this:

="javascript:void(window.open('https://na5.salesforce.com/" & Fields!id.Value & "','_blank'))"

我为此苦苦挣扎了很长时间,但只要您小心地将所有内容正确组合在一起,就可以使这些变得非常复杂.您还可以在同一个动作表达式中添加多个 javascript 命令(但不能添加函数).下面是我最复杂的 SSRS Go-to-URL Action 命令之一:

I struggled with this for a long time, but you can make these pretty complex as long as you're careful to put everything together correctly. You can also add multiple javascript commands (but no functions) in the same action expression. Below is one of my most complicated SSRS Go-to-URL Action commands:

="Javascript:"
    & IIF(left(Fields!Name.Value,11)="RESTRICTED-",
        "alert('Restricted!'); ","") & IIF(Fields!Name_Alert.Value = 1, "alert('Alternate Alert!'); ","")
    & "void(window.open('"
    & Globals!ReportServerUrl
    & "/Pages/ReportViewer.aspx?%2fJPD%2fPO_Dashboard%2fJuvenile_Profile&rs:Command=Render"
    & "&rc:Parameters=true"
    & "&Emp_Number="
    & Parameters!Param1.Value
    & "&ID=" & Fields!ID.Value & "'));"

关键是确保 javascript 所需的所有必要的单引号都显示在字符串中(即'").

The key is to make sure that any and all necessary single quotes required by javascript show up inside a string (i.e., "'").

这篇关于在新窗口中打开 SSRS URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 18:14