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

Javascript won't execute when viewed through reportviewer

Status
Not open for further replies.

reportingtroubles

Technical User
Oct 24, 2008
3
US
Working with SQL Server 2005 SP2 and MOSS 2007. Reporting services running in Native mode.

I have a report where I am using the navigation 'jump to url' with the code:

="javascript:void(window.open('htxp://<website>/" & Fields!Field.Value & "/default.aspx', '_blank'))"

also tried:

="javascript.void: (window.location.href='htxp://<website>/" & Fields!Field.Value & "/default.aspx')"

These work when the report is viewed from the report manager. This also works when using the combination of the Report Explorer and the Report Viewer web parts together.

However, when only the reportviewer webpart is on the page linking directly to the report the javascript does not work. The report runs, and in the lower left in IE(7) the message 'javascript.void: (window.location.href="...") shows, the pointer turns to the little hand... click... Nothing. Trying to right click and 'open in new window' (or new tab) does nothing either.

I have looked all over the place and have only found a few threads referring to this situation, but no answers.

Any help is hugely appreciated.

Thanks!
Eric
 
This has been submitted to MS PS and is looking like a bug. Another idea they had was to put code in report properties, but this didn't work either.

I will post findings to benefit others in the future.

~Eric
 
Hi, did you ever get a solution for this? I had it working and it suddenly stopped working.
 
Forgot about this... yes, I did get an answer. Of course the answer was - this is a 'feature'. It happens because of the way IE handles security and javascript, which is why it works in other browsers (only tested Chrome).

I just took the javascript out so the link could stay there and put text above in a different web-part explaining the behavior. This way if the user wants to have it open in a different window they can just ctrl+click.

Hopefully this helps :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top