Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SSRS2008-使用javascript对带有符号的URL进行编码_Javascript_Sql Server 2008_Reporting Services_Ssrs 2008 - Fatal编程技术网

SSRS2008-使用javascript对带有符号的URL进行编码

SSRS2008-使用javascript对带有符号的URL进行编码,javascript,sql-server-2008,reporting-services,ssrs-2008,Javascript,Sql Server 2008,Reporting Services,Ssrs 2008,标题有点让人困惑,但我还是被难住了 我有一个可点击的链接,它将打开您的默认邮件客户端(在本例中,我们的是Outlook),并格式化一个可点击的URL。除非URL中有一个符号,否则它99%的时间都很有效。我已经用%26替换了-,并且没有运气。URL仍然会切断符号所在的位置 在SSRS中,我将此设置作为超链接表达式 =iif(Fields!EmailShippingURL.Value="URL Unavailable" OR Fields!ShippingURL.Value="URL Unavail

标题有点让人困惑,但我还是被难住了

我有一个可点击的链接,它将打开您的默认邮件客户端(在本例中,我们的是Outlook),并格式化一个可点击的URL。除非URL中有一个符号,否则它99%的时间都很有效。我已经用%26替换了-,并且没有运气。URL仍然会切断符号所在的位置

在SSRS中,我将此设置作为超链接表达式

=iif(Fields!EmailShippingURL.Value="URL Unavailable" OR Fields!ShippingURL.Value="URL Unavailable" OR isNothing(Fields!EmailShippingURL), "javascript:(alert('The shipment info cannot be processed. There is either no email address for this contact or invalid shipping information.'))", "javascript:void(window.open('"+ Fields!EmailShippingURL.Value + "','_blank'))")

我认为可以使用chr()函数-

"javascript:void(window.open('"+ replace(Fields!EmailShippingURL.Value, "&", chr(38)) + "','_blank'))"
或者javascript转义函数-

"javascript:void(window.open('"+ replace(Fields!EmailShippingURL.Value, "&", "'+escape('&')+'") + "','_blank'))"