Monday, February 20, 2012

Navigation: Jump to URL

Hello,
I have been trying for a while to get one field in my report to link to
a page on my local server. I have looked in the older post as well as on
the internet and have found so examples that just don't work for me. I
am running SRS SP2 and using an MSCRM database as my source. The code I
am using is as follows: = "javascript:void(window.open('http://crm/SFA/leads/edit.aspx?id={' &
Fields!leadid.Value.ToString & '}'))". I am incredibly new to javascript
and sort of know what this code does but I don't know if I am using the
function correctly and if this function will even work. When I use the
hyperlinked field, my screen flickers and nothing happens. So any help
you can offer will be greatly appreciated.
Regards,
Jeff JonesYou are assembling a string here. Change it to this:
= "javascript:void(window.open('http://crm/SFA/leads/edit.aspx?id={'" &
Fields!leadid.Value.ToString & "'}'))".
You need the additional double quotes.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Jeffrey Jones" <jeffjones176@.kc.rr.com> wrote in message
news:eTc1s1PpFHA.1048@.tk2msftngp13.phx.gbl...
> Hello,
> I have been trying for a while to get one field in my report to link to a
> page on my local server. I have looked in the older post as well as on the
> internet and have found so examples that just don't work for me. I am
> running SRS SP2 and using an MSCRM database as my source. The code I am
> using is as follows: => "javascript:void(window.open('http://crm/SFA/leads/edit.aspx?id={' &
> Fields!leadid.Value.ToString & '}'))". I am incredibly new to javascript
> and sort of know what this code does but I don't know if I am using the
> function correctly and if this function will even work. When I use the
> hyperlinked field, my screen flickers and nothing happens. So any help you
> can offer will be greatly appreciated.
> Regards,
> Jeff Jones|||Bruce L-C [MVP] wrote:
> You are assembling a string here. Change it to this:
> = "javascript:void(window.open('http://crm/SFA/leads/edit.aspx?id={'" &
> Fields!leadid.Value.ToString & "'}'))".
> You need the additional double quotes.
>
Thank you for pointing that out. Though, after I change my syntax, I
still can't get the code to work. Could this be an explorer setting? I
have tried this same code but with google.com replaced with my crm url.
My screen flashes and windows makes a 'ding' sound and then nothing.
Looked in the event logs. Nothing. Looked at the task manager as I was
firing the link. Nothing. I don't really know what is happening with
this. Any other suggestions would be helpful.
Thanks,
Jeff|||Here is a working one for me. Take the following line and cut and paste it
into the jump to url.
= "javascript:void(window.open('http://www.google.com','_blank'))"
Note that you have to have SP1 or SP2 installed for this to work.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Jeffrey Jones" <jeffjones176@.kc.rr.com> wrote in message
news:eMg$$o0pFHA.1024@.TK2MSFTNGP09.phx.gbl...
> Bruce L-C [MVP] wrote:
>> You are assembling a string here. Change it to this:
>> = "javascript:void(window.open('http://crm/SFA/leads/edit.aspx?id={'" &
>> Fields!leadid.Value.ToString & "'}'))".
>> You need the additional double quotes.
>>
> Thank you for pointing that out. Though, after I change my syntax, I still
> can't get the code to work. Could this be an explorer setting? I have
> tried this same code but with google.com replaced with my crm url. My
> screen flashes and windows makes a 'ding' sound and then nothing. Looked
> in the event logs. Nothing. Looked at the task manager as I was firing the
> link. Nothing. I don't really know what is happening with this. Any other
> suggestions would be helpful.
> Thanks,
> Jeff|||Bruce L-C [MVP] wrote:
> Here is a working one for me. Take the following line and cut and paste it
> into the jump to url.
> = "javascript:void(window.open('http://www.google.com','_blank'))"
> Note that you have to have SP1 or SP2 installed for this to work.
>
I have learned that spacing matters with this particular section of the
program. The syntax of the day is: ="javascript:void(window.open('http://crm/SFA/leads/edit.aspx?id={"&
Fields!leadid.Value &"}'))". There is a space between the amperstands
and the Fields name. Any thing less than this exact syntax will not
work. Also the link will not work in the VS dev. env. The report needs
to be deployed before it will work worth a darn. Since leadid is a GUID
and SRS does not play nice with GUIDs, you need to use <CAST(Lead.LeadId
as nvarchar(80)) as leadid> when creating your dataset. Follow all of
this and you will have a nice day.
Regards,
Jeff

No comments:

Post a Comment