hyperlink in a new window in Reporting Services Report

19/02/2009

תגיות: , , ,
7 תגובות

Reporting Services gives you several ways to navigate within your report or navigating to external item (i.e. Navigating to other reports or any web URL).
You can use a feature called "Jump to URL". Use the following steps to set "Jump to URL"


Method-1
– Drag a datafield on the report
– Click on the Textbox
– Find the Action property of Textbox the property window
– Select Jump to URL option
– Type any valid URL (i.e. http://blogs.microsoft.co.il/blogs/bilive), valid URL must start with protocol like http: ,ftp:, mailto: …


Method-2
– Drag a datafield on the report
– Right click and open properties dialog box (or just look in the property window ->Action ->Jump to URL)
– Click on "Advanced >>"
– Click on the navigation tab
– Select "Jump to URL"
– Type any valid URL (i.e. http://blogs.microsoft.co.il/blogs/bilive)



Opening Link in a new window
Well this is very common requirement but unfortunately there is no direct option available in Reporting Services Designer. You can do that using the following technique
Use the following expression in the "Jump to URL"
Note: The following expression will only work if you have applied SP1 or Higher for SQL Reporting Services


="javascript:void(window.open('http://blogs.microsoft.co.il/blogs/bilive','_blank'))"

How to overcome expression length limitation
Another limitation of "Jump to URL" field is you are limited to Maximum expression characters. You can solve this problem by using "Dummy parameters". You can create parameters for report without any prompt string and then specify default value which will act as a constant for your report.
For example if I have a really long URL which is not allowed in the "Jump to URL" expression then I can create a new report parameter called CW_URL. Set your long URL as default value for this parameter. Now remove any prompt string for this parameter so it wont appear when you run your report.
default value for cw_url => 'http://blogs.microsoft.co.il/blogs/bilive/ID.aspx?Id=
Now you can type the following expression in "Jump to URL" to get dynamic URL based on Database field called ID and static URL from cw_url hidden parameter.


="javascript:void(window.open('" & Parameters!cw_url.Value & Fields!Id.value & "','_blank'))"

Enjoy,

Ronen

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *

7 תגובות

  1. Shlomo19/02/2009 ב 23:07

    גאוני, תודה רבה

    הגב
  2. Fong03/12/2009 ב 16:37

    i try to put into the report builder 2.0 , but its does not work .. it end out with no URL Link …

    הגב
  3. yooluo30/12/2009 ב 05:35

    i get the problem same as Fong.

    הגב
  4. yooluo30/12/2009 ב 09:20

    I has solved this problem,you can write the javascript for the hyperlink.

    example:
    input the dialog for the hyperlink

    ="javascript:alert('hello!I come from http://www.yooluo.com/')"

    this javascript will run in the web page,but can't run in the report builder,so you must see the report in the web page.

    הגב
  5. yooluo30/12/2009 ב 09:46

    the "BLOCKED SCRIPT" = " javascript:"

    הגב
  6. kanagarajan S29/03/2011 ב 13:51

    How to open pop up window in ssrs

    הגב
  7. claude29/08/2011 ב 17:26

    Perdonen, el mensaje es quitado
    http://www.offporn.com/

    jordyn

    הגב