Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
747 views
in Technique[技术] by (71.8m points)

reporting services - SSRS: Relative URL Hyperlink

In SSRS 2008 I would like to create a relative path URL. Long story short I have a subscription that outputs a few thousand static HTML pages to a folder that is used as content for a website. In the past I have created full URLs to other pages on the site (sub-reports, really) using Text Box Properties -> Action -> Go to URL. I would like to modify my code so that it returns the relative path of the target instead of the full URL. This will reduce the likelyhood that someone will eventually break the navigation by changing the website domain or folder structures. When I tried to make this work, the objects that were previously clickable are no longer, well, clickable. How do I make a SSRS hyperlink jump to a relative URL instead of a fully-qualified URL?

Here's what works:

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

Here's what doesn't work:

="../" + 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"
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Just read this Q and A and have a better solution for anyone looking. If you want relative url then just use javascript e.g.

="javascript:void(window.navigate( '/mydirectory/reportcountry.aspx?CountryID=" + Fields!CountryID.Value.ToString() + "'))"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...