Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Conditionally Go To URL in a new window Expand / Collapse
Author
Message
Posted Friday, April 5, 2013 8:21 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, January 30, 2014 2:09 PM
Points: 29, Visits: 135
I have a conditional hyperlink set up in my SSRS 2008 report.

=iif(Fields!budgetid.Value>1,"http://system/forms/Summary.aspx?BudgetId="&Fields!budgetid.Value,"")


This works fine. However, it is opening over my report and I don't want that. I want to open it in a new window. I know that this can be done using Javascript, but so far I've been unsuccessful in my attempts. I know I'm off with the spacing, and where single quotes should be used and where double quotes should be used.

=iif(Fields!budgetid.Value>1,"void(window.open('http://system/forms/Summary.aspx?BudgetId='&Fields!budgetid.Value,'_blank')),"")

Something like this, but it's not working.

Any help would be greatly appreciated. Thanks!
Jamey

Post #1439250
Posted Friday, April 5, 2013 8:31 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 5:32 PM
Points: 1,796, Visits: 5,801
jamey8420 (4/5/2013)
I have a conditional hyperlink set up in my SSRS 2008 report.

=iif(Fields!budgetid.Value>1,"http://system/forms/Summary.aspx?BudgetId="&Fields!budgetid.Value,"")


This works fine. However, it is opening over my report and I don't want that. I want to open it in a new window. I know that this can be done using Javascript, but so far I've been unsuccessful in my attempts. I know I'm off with the spacing, and where single quotes should be used and where double quotes should be used.

=iif(Fields!budgetid.Value>1,"void(window.open('http://system/forms/Summary.aspx?BudgetId='&Fields!budgetid.Value,'_blank')),"")

Something like this, but it's not working.

Any help would be greatly appreciated. Thanks!
Jamey



Try this (replace the á with a regular a):

=iif(Fields!budgetid.Value>1,"jávascript:void(""window.open('http://system/forms/Summary.aspx?BudgetId=" & Fields!budgetid.Value & "','_blank'))","")



MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1439256
    Posted Friday, April 5, 2013 8:59 AM
    SSC Rookie

    SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

    Group: General Forum Members
    Last Login: Thursday, January 30, 2014 2:09 PM
    Points: 29, Visits: 135
    Thanks MM,

    I changed the code and nothing happened when I clicked on the link.

    When I viewed the properties of the link, this is what I see:

    void(%22window.open('http://system/forms/Summary.aspx?BudgetId=2849','_blank'))


    When I remove the %22 (double quote) and paste it into a browser, the link does work - I am prompted to allow pop-ups, but this doesn't surprise me. However, when I removed it from the report, it doesn't compile. Any ideas?
    Post #1439271
    Posted Friday, April 5, 2013 9:20 AM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Yesterday @ 5:32 PM
    Points: 1,796, Visits: 5,801
    Oh yeah, sorry - that's the problem with typing code into this forum !
    Try this (replace the á with a regular a):

    =iif(Fields!budgetid.Value>1,"jávascript:void(window.open('http://system/forms/Summary.aspx?BudgetId=" & Fields!budgetid.Value & "','_blank'))","")



    MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1439280
    Posted Friday, April 5, 2013 9:38 AM
    SSC Rookie

    SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

    Group: General Forum Members
    Last Login: Thursday, January 30, 2014 2:09 PM
    Points: 29, Visits: 135
    That link works; thanks.

    One related question. My SSRS report is in a window that doesn't have the URL displayed. So when I click on my link, nothing is still happening. I'm not seeing the prompt to Allow Pop-ups, which will allow the link to work.

    Do you know of anyway to automate this process through the link? I don't think this is possible, but thought I'd ask. Or maybe another way around this issue?

    Thanks,
    Jamey


    Post #1439306
    Posted Friday, April 5, 2013 9:42 AM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Yesterday @ 5:32 PM
    Points: 1,796, Visits: 5,801
    jamey8420 (4/5/2013)
    That link works; thanks.

    One related question. My SSRS report is in a window that doesn't have the URL displayed. So when I click on my link, nothing is still happening. I'm not seeing the prompt to Allow Pop-ups, which will allow the link to work.

    Do you know of anyway to automate this process through the link? I don't think this is possible, but thought I'd ask. Or maybe another way around this issue?

    Thanks,
    Jamey




    Sorry, no.


    MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1439310
    Posted Friday, April 5, 2013 10:21 AM
    SSC Rookie

    SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

    Group: General Forum Members
    Last Login: Thursday, January 30, 2014 2:09 PM
    Points: 29, Visits: 135
    As a test, I ran my report in a window that does display the URL, everything on it. When I hover over the link, I can see it and it's formed properly.

    When I click, nothing happens. When I copy the shortcut, and paste it into another window, I am prompted for pop-ups and then it works.

    My report is in another window, but it's also being viewed from within an iFrame. May this be causing the issue? Just doesn't seem I can link to another page outside of that iFrame.

    Thanks,
    Jamey
    Post #1439348
    « Prev Topic | Next Topic »

    Add to briefcase

    Permissions Expand / Collapse