Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open in New Browser Window

Status
Not open for further replies.

AurobindoSaha

Programmer
Mar 11, 2004
57
US
Here's a situation for which I am trying to find a solution for a long time.

1. User is in a particular report - lets call that "Report A"

2. Report A has SOME hyperlinks

3. Clicking ONE of these hyperlinks takes me to another report lets call it Report B. Actually clicking on that one particular hyperlink on Report A passes some parameters and runs Report B and opens that.

4. All I want is to open this Report B in new browser window. Let Report A remain open in back as it is.

5. Point to remember - clicking on the other hyperlinks other than the particular hyperlink I mentioned (in Report A) should not open in new window.

Any idea how is this possible?

We use CE10.0, Crystal Report Designer 10, RAS, IE 6.0.2800.1106, CSP pages and JavaScript to code the web interface.

This requirment is very urgent. Your help will be highly appreciated.

Aurobindo
 
I haven't had to use Crystal reports with hyperlinks yet, so I can't speak from CR experience. But typical browser behavior lets you hold down the Shift key when clicking a link that you want opened in another window.

You can tell a hyperlink to open in a separate window in this fashion:
Code:
<A HREF="[URL unfurl="true"]http://pm99.laramie.org:7777/forms90/f90servlet?config=fnd"[/URL] [b]BASE TARGET="_blank"[/b]>Product</A>

The tag <BASE TARGET="_blank"> can also be put on an HTML page (inside the <head>...</head> section) to tell the browser to open ALL links in new windows.

The alternate argument to _blank is _top for links that need to open in the SAME window.
 
Hi mdwyer,

Thanks for your response. I am aware of this functionality and the equilavent functionality for the crystal report viewer object is HyperlinkTarget

viewer1 = Server.CreateObject("CrystalReports.CrystalReportViewer");
viewer1.HyperlinkTarget = "_blank"

But it will set the property for all the hyperlinks in that page to open in a new window.

What I am looking for is that -

1. there are specific fields (in report A) when clicked will open Report B in new window,
2. where as other hyperlinks on same Report A when clicked open in same window.

That is somehow to manupulate the page to open in new window that gets processed after clicking.

Do you have any idea for this type of situation? Yes, one solution is to hold the shift button before clicking. But that a bad solution, can't we do something programatically?

If you like, you can talk to me at +1 303 624 3066 or give your phone number so that we can discuss the issue.

Thanks in advance.

Aurobindo
 
Hi,

Huggy has suggested something like this. But I cannot understand that. Can someone explain this to me in more details. Specially where to put

"onclickjavascript:window.open("

Thanks AS

From Huggyd:

I've done this by using javascript to open the new window and the viewer.GetHTMLContent as this allows you to modify the code used in the viewer. Stage 1 is setting the hyperlink in the crystal report to be pseudo code that will be replaced in the viewer page:

"onclickjavascript:window.open("
followed by the report path and params.

Within the viewer code :

reportView = viewer1.GetHTMLContent( Request, Response, Session )

reportView = replace(reportView,"href=" & chr(34) & "onclickjavascript", "onclick=" & chr(34) & "javascript")

The down side with this is that some functionality of the viewer isn't available when using GetHTMLContent so i've had to code that back in as well.
 
Hi,
Waiting long for your answer.

Can anyone comeup with some solution for this? Its the last bottleneck for my Crystal 10 migration.

Thanks

Aurobindo
 
Aurobindo -

Did you ever get this to work?

I have not used hyperlinks in reports but was just reading about the capability today and gave one a try. Just so we're on the same page, I did this in the report designer, selecting a field on the report, right-clicking and selecting Format Field. On the Hyperlink tab, I set the Website Address to
Code:
[URL unfurl="true"]http://www.classmates.com/[/URL] BASE TARGET="_blank"
and it worked just fine. Granted, this is not a report hyperlink, but it does use the BASE TARGET="_blank" arg to open the site in a new browser.

What I did have to do was add the final slash - .com/ not .com - to make it work. Crystal wanted to add a closing slash and put it after blank", and that failed to find the site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top