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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript pop-up in CE XI 1

Status
Not open for further replies.

psvaishnav

Programmer
Apr 1, 2003
5
IN
Hi.

We are evaluating CE XI in place of CR9 RAS.

One of the reports we have has a hyperlink to a custom coded JSP page. The link was inserted in the Hyperlink Tab of the Format Field option as follows:

"javascript:eek:penPopUp("+ ToText(Join(Split(CStr({<database field name>},0),","),"")) + ")"

where openPopUp is a custom function, and the value from the database field is being passed as a parameter.

In CE XI, so far we have found that hyperlinks passed as above are ignored while displaying the report in the DHTML viewer.

Any tips on how to achieve this will be highly appreciated.
 
This used to work in CE10 also, but not in XI. [sad]

I've no idea if this is by design, or a bug.

I would try to get a reply from Business Objects as to why this was removed.

However I guess you could call a web page and pass it the field name as a parameter.

Kingfisher [CECP]
 

As Kingfisher mentioned CR XI doesn't allow you to call java script functions.

However if you are calling java script function just for opening the url in new browser window. Then you can do this by,

CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setHyperlinkTarget("_blank");

Jayaramu
 
Thanks, jayaramuds - that seems to have solved our problem :)
 
Hi Kignfisher.

From psvaishnav's posting I realised that they were using openPopup java script function for opening a page in new browser window.

In designer, I asked him to change java script function to actual url.

Old code in rpt
--------------------------------------------
"javascript:eek:penPopUp("+ ToText(Join(Split(CStr({<database field name>},0),","),"")) + ")"
--------------------------------------------

new code I asked to modify is
--------------------------------------------
"/url/"+ ToText(Join(Split(CStr({<database field name>},0),","),""))
note: url is the actual url
---------------------------------------

finally calling function "viewer.setHyperlinkTarget("_blank");" will open href in new window. By default the value is "_self".

I hope this clears your doubt. Let me know if you still didn't understand it.
 
Thanks Jayaramu,

I understand this (it is basically what I was saying in my last sentence, only much better put).

I was hoping there was/is a way to do it without custom code (i.e. directly in the link) and without changing the browser's behavior (to open every link in a new window).
I was also caught up in my Javascript:alert("foo") test rather than openPopUp.

Kingfisher [CECP]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top