Want Hyperlink to Open in a New Window

Greetings. I have added a hyperlink to a report, and it works like a charm. Now I would like to change it so that when the link is clicked on, it opens the URL in a new browser. I cannot seem to find any information out there on this issue. Has anyone figured out how to do this?

Here is the RDL from the report I'm working with:

<Action>

<Hyperlink Target="_blank">

=Trim(Fields!sfa_WebServer.Value) &amp; "SFADetail_IntakeCoordinator.aspx?Record=" &amp; Fields!url.Value

</Hyperlink>

</Action>

I added the Target="_blank", thinking that would take care of it, but it had no impact.

Thanks for any help you can offer.
Erik

[987 byte] By [ErikHanson] at [2007-12-16]
# 1
You have to use a hyperlink expression like this:
=void(window.open(' http://www.xyz.com"','_blank'))"

Note: be careful with single vs. double quotes when doing VB string concatenation vs. Javascript strings.

-- Robert

RobertBrucknerMSFT at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 2
Thanks for the reply. I think I am getting close! I modified my code, per your suggestion, and it now looks like this:

<Hyperlink>

=void(window.open('" &amp; Trim(Fields!sfa_WebServer.Value) &amp; "SFADetail_IntakeCoordinator.aspx?Record=" &amp; Fields!url.Value &amp; "','_blank'))"

</Hyperlink>

When I try to preview the report, I get the following error:

"The url BLOCKED SCRIPTvoid(window.open('http://nbrwb02:8080/SFADetail_IntakeCoordinator.aspx?Record=7','_blank')) has an invalid schema. URLs in reports may only use http://, https://, ftp://, mailto: or news:"

From my point of view, the good news is that the url in the error message is correct, so my fields are being read correctly. Unfortunately, I cannot get around this error yet.

ErikHanson at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 3
="javascrippt:void(window.open(' http://...','_blank'))" works fine for me. Please note that javascrippt is misspelled on purpose. For some reason, if spelled correctly, the post was losing the string.

KKaps at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 4
Yes, my initial posting included the Javascript part but for some reason it got removed because it thinks it is an embedded script in the posting ...
RobertBrucknerMSFT at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 5
Okay, it's working now, sort of. I downloaded SP2, and now I don't get the error I referred to earlier in this thread.

There is just one little hitch. When I click on the link, two windows open. Here are the two urls I get.

First window:
javascrippt:void(window.open('http://www.yahoo.com))
(Note: javascrippt is intentionally misspelled in this forum so that it is not deleted).

Second window url:
http://www.yahoo.com

Any ideas on what I should do to get rid of the first window?

ErikHanson at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 6
Hum...why don't you ask the user to right click the link and select "Open in a new window" ?
F.Dwarf at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...

SQL Server

Site Classified