SSRS计划的订阅超链接不起作用

我目前正在使用Reporting Services 2014.我正在使用下面的代码,以便能够在SharePoint站点本身上使用JavaScriptpopup窗口。 该代码还解决了通过iif语句导出到Excel链接的问题,该语句评估RenderFormat是否在网站上被查看,或者是否是另一种格式(Excel,Word,PDF等)。 iif语句使用一个用相应的站点replaceReportServerURL的variables。 当使用站点上的链接以及从站点导出到Excel时,一切正常。

当我设置发送报告的Excel文件的预定订阅时,会发生此问题。 ReportSerURL与上述情况不同。 我们有两个站点在预定的订阅excel文件中使用http:// gsp1 / ReportServer和http:// gsp2 / ReportServer 。

这是我目前使用在网站上使用超链接和从网站导出到Excel的代码。 有没有办法,我也可以纳入一些逻辑来解决预定的订阅文件?

SSRS URL操作(使用下面的variables)

=iif( (Globals!RenderFormat.Name = "RPL"), "javascript:void(window.open('"+ Variables!RxDrill.Value + "&rv:ParamMode=Hidden&rv:Toolbar=None&rv:HeaderArea=None&rp:StoreKey=" + Fields!StoreKey.Value.ToString + " &rp:RxNumber=" + Fields!RX.Value.ToString + "&rp:RefillNumber=" + Fields!RefillNumber.Value.ToString + "', 'RXOVERVIEW','width=1335,height=450,location=no'))", Variables!RxDrill.Value + "&rp%3aStoreKey=" & Fields!StoreKey.Value & "&rp%3aRxNumber=" & Fields!RX.Value & "&rp%3aRefillNumber=" & Fields!RefillNumber.Value & "&rs%3aParameterLanguage=") 

variables

 =Replace(Globals!ReportServerUrl,"/_vti_bin","/_layouts/15") + "/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRS%20Library/Rx Transaction Detail.rdl" 

这是我目前得到的错误,当试图打开一个订阅Excel电子邮件文件中的链接。 在这里输入图像说明

我放弃了一个[&ReportServerUrl]文本框,发现预定的订阅path与浏览器中或导出到Excel时不一样。 我发现有2个可能的订阅使用的ReportServerURLs。 http:// gsp1 / ReportServer或http:// gsp2 / ReportServer 。 在浏览器中,它始终是https://abc.myinfocenter.net/_vti_bin/ReportServer ,但是从上面的variables代码可以看出_vti_bin被replace。

看来问题在于,当您通过sharepoint加载报表时,您正在使用Globals!ReportServerUrl值检索SharePoint Server信息。 但是,通过在不同的SSRS服务器上订阅,您正在检索不同的服务器值:生成订阅的服务器。 SharePoint知道它在服务器上,并可以告诉SSRS,当您通过SharePoint网站访问报告。 但是,直接生成SSRS服务器上的报表时,SSRS服务器不知道SharePoint网站甚至存在。

为了解决这个问题,你需要告诉SSRS服务器SharePoint站点的URL。 您可以将SharePointurl硬编码为variables或其他地方的expression式,但是这样做有点难以维护。 我会build议以下面的方式解决这个问题,使维护更容易和更透明:

  1. 在您的报告中创build一个名为SharePointURL的新参数。 将默认值设置为https://abc.myinfocenter.net/_vti_bin/ReportServer,或者当报告在浏览器中正确生成时的内容。 您将其作为参数进行操作的原因是,如果您的SharePoint网站发生更改,则可以更轻松地进行维护。 将此参数设置为隐藏或内部。

  2. 更改variables的expression式以合并SharePointURL参数。

新的variablesexpression式:

 =Replace(IIF(Globals!RenderFormat.Name = "RPL",Globals!ReportServerUrl,Parameters!SharePointURL.Value),"/_vti_bin","/_layouts/15") + "/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRS%20Library/Rx Transaction Detail.rdl" 

希望这将解决您的问题。