代码之家  ›  专栏  ›  技术社区  ›  Registered User

SSRS:相对URL超链接

  •  6
  • Registered User  · 技术社区  · 16 年前

    如何使SSRS超链接跳转到相对URL而不是完全限定的URL?

    ="https://some.domain.com/some_page/" + Fields!Custom_Page_Name.Value.ToString() + ".html"
    

    以下是不起作用的:

    ="../" + Fields!Custom_Page_Name.Value.ToString() + ".html"
    ="/" + Fields!Custom_Page_Name.Value.ToString() + ".html"
    =Fields!Custom_Page_Name.Value.ToString() + ".html"
    ="..\" + Fields!Custom_Page_Name.Value.ToString() + ".html"
    ="\" + Fields!Custom_Page_Name.Value.ToString() + ".html"
    
    5 回复  |  直到 16 年前
        1
  •  8
  •   Michael Fredrickson    13 年前

    只要阅读这篇问答,就可以为任何人提供更好的解决方案。如果您想要相对url,那么只需使用javascript即可。

    ="javascript:void(window.navigate( '/mydirectory/reportcountry.aspx?CountryID=" + Fields!CountryID.Value.ToString() + "'))"
    
        2
  •  7
  •   Malcolm    16 年前

    如果查看在Visual Studio中运行报告时生成的警告,您将得到以下答案:

    i、 URL必须有这些协议中的一个,因为当它以协议开始时,没有办法写入相对URL,这意味着SSRS不支持相对URL。

    另一种方法是在参数中设置基本URL,这样很容易更改,并且只需要在更改时重新生成html页面。

        3
  •  3
  •   Madhan    14 年前
    ="javascript:void(window.open(document.URL.replace('CurrentReportName','NavigateToReportName'),'Window1','menubar=no,width=430,height=350,toolbar=no'));"
    

    我知道这是一个老帖子。注意:我使用的是SSRS2008

        4
  •  1
  •   Alex Z    11 年前

    只需使用全局变量 Globals!ReportServerUrl

    所以 "http://myservername/rs?/myreportname" 变成 Globals!ReportServerUrl + "?/myreportname"

        5
  •  0
  •   John    10 年前

    在Visual Studio 2013中,使用SQL Server数据工具,您可以访问标签的属性页。这提供了链接到另一个报告(在同一项目中)并根据需要传递任何参数的选项:

    Screenshot of property pages.

    推荐文章