How to use Java script in SSRS 2008

  • Hi all,

    Any idea how to use Java Script in SSRS 2008 ?

    In 2005 if I have to navigate to a report (same report again or another report), I was using the Jump to URL option and there I give the Java script something like

    "void window.open('"+Globals!ReportServerUrl+"?"+Globals!ReportFolder+"/"+

    But in SSRS 2008 when I tried the same Im getting error telling that the Jump to URL expect and expression like http://

    Any one has some idea on this ?

    Thanks & Regards,
    MC

  • Yes, there is SSRS architucture difference in 2008,like webserver(IIS) not required it will run directly from the report server. Give directly the server path and the report and pass the values from browser.

    Thanks & Regards,
    Veeren.
    Ignore this if you feel i am Wrong. 😉

  • Hi thanks for reply.

    I know SSRS 2008 has no dependency on IIS , so you mean to say we need to give the report server link http://locahost/reports... ?

    In that case if I specify the full path of the report can we pass the parameter value also ?

    Thanks & Regards,
    MC

  • Hello,

    Yes,we can pass the parameters in browser please read the below url for more info.

    http://www.mssqltips.com/tip.asp?tip=1336

    Not sure in your case.But hopefully it will help you.

    Veeren

    Thanks & Regards,
    Veeren.
    Ignore this if you feel i am Wrong. 😉

  • Hi thanks for reply,

    What I was trying to use is in the Jump to URL option we can give as

    "void window.open('"+Globals!ReportServerUrl+"?"+Globals!ReportFolder+"/"+

    but when I tried to use this in SSRS 2008 , I was getting the error as "The Jump to URL expression expects expression like http:// "

    In SSRS 2005 I was able to use this.

    Thanks & Regards,
    MC

  • Why the insistence on using js? Why not use the built in properties or the report. The error message is pretty specific. It wants a url that starts with http:// you're not giving it one.

    Can you not generate the same expression without the js window.open()? and use it in the action properties of the textbox?

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Hi Luke,

    Thanks for your reply.

    In SSRS 2005 I was doing it like this , so when moved to SSRS 2008 I was trying the same.

    And as I'm using the JS , I can get the report opened in new window.

    Do you mean to say with out using the JS we can do the same...?

    Thanks & Regards,
    MC

  • only4mithunc (6/2/2010)


    Hi thanks for reply,

    What I was trying to use is in the Jump to URL option we can give as

    "void window.open('"+Globals!ReportServerUrl+"?"+Globals!ReportFolder+"/"+

    but when I tried to use this in SSRS 2008 , I was getting the error as "The Jump to URL expression expects expression like http:// "

    In SSRS 2005 I was able to use this.

    In the bolded section above is this what you are including as your url? or are you using the java<removeme>script:(with the <removeme> removed) tag first? This forum has issues with the word java<removeme>script: and is why I ask. Just trying to see exactly what the issue is.

    Perhaps you have a character in your string which is causing you some issues. You could take a look at this blog post and see if it doesn't help some.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Hi Luke,

    This is the full script I have used.

    ="void window.open('"+Globals!ReportServerUrl+"?"+Globals!ReportFolder+"/"+"MyReport&rs:Command=Render&rc:Parameters=false&ID="+Parameters!ID.Value.ToString()"')"

    And as I mentioned this was working with SSRS 2005 , but not in SSRS 2008 🙁

    Thanks & Regards,
    MC

  • Luke you are correct , In the above reply I have pasted the complete script but in this forum it is removing that initial part...

    But in the expression of the rdl I have given the complete expression, but don't know why only in SSRS 2008 I'm getting the error.

    Thanks & Regards,
    MC

  • Hi friends I was away for a couple of days from this request...

    I'm still trying to get a solution.

    Luke / Veeren ,

    As you mentioned I can use the http:// link directly, but the problem is if I'm not using the js:void window.open() , after deploying it to the Report server from BIDS, when I click the navigation from main report, the other report is getting open in the same window.

    If I can use the JS it will open in another window (thats what I need) , but this I'm not able to do in SSRS 2008.

    Please let me know your ideas...

    Thanks & Regards,
    MC

  • only4mithunc (6/9/2010)


    Hi friends I was away for a couple of days from this request...

    I'm still trying to get a solution.

    Luke / Veeren ,

    As you mentioned I can use the http:// link directly, but the problem is if I'm not using the js:void window.open() , after deploying it to the Report server from BIDS, when I click the navigation from main report, the other report is getting open in the same window.

    If I can use the JS it will open in another window (thats what I need) , but this I'm not able to do in SSRS 2008.

    Please let me know your ideas...

    I don't realy have any other ideas to add other than to perhaps try and edit the .RDL file itself. Take a look at the following...http://qa.sqlservercentral.com/Forums/Topic932598-392-1.aspx the last post deals with it a bit, just remember that the java_script keywords get stripped out because of the forum, so keep that in mind while copying the code.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • Thanks a lot Luke,

    Something strange happened, I gave the expression like below and it started working, really don't know why before it was throwing an error as "expecting http://" 🙁

    ="js:void window.open('"+Globals!ReportServerUrl+"?"+Globals!ReportFolder+"/"+"Sub&rs:Command=Render&rc:Parameters=false&sd="+Fields!ID.Value.ToString()+"')"

    here I just gave js (if I give the expansion it might get cut in the forum)

    Thanks once again to all who tried to help me.

    Thanks & Regards,
    MC

  • Glad it worked out for you.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply