Link to home
Start Free TrialLog in
Avatar of ShyamSundarB
ShyamSundarB

asked on

Opening Hyperlinks inside Excel WebAccess webpart in the Same Window

Hello Experts,

Here is the Scenario!!!

I have a SharePoint page that has an Excel Webaccess webpart which is rendering an excel workbook.This excel workbook has hyperlink values in it.

When i click the hyperlink it is opening in new window, my requirement is to open the link in the same window.

Since the environement is SharePoint 2010, the webpart is rendered in nested Divs rather than iframes(use to be in 2007).I tried changing the target for the <a> tag using javascript and the target frame got changed, but the link in not opening in new window.

Note : I'm using SP2010 environment.

Appreciate your thoughts/inputs..
Avatar of tbsgadi
tbsgadi
Flag of Israel image

Have a look at Creating a hyperlink in Office Excel for use in Excel Services

http://office.microsoft.com/en-001/sharepoint-server-help/using-hyperlinks-in-excel-services-HA010173679.aspx

Gary
Avatar of ShyamSundarB
ShyamSundarB

ASKER

@ Gary,

The link just explains how to hyperlink a column in Excel. I have all those stuffs implemented, but when i click the hyperlinked data it is opening in new window; i want to open it in same window or say i have an iframe in the page and when i click the link,it should be opened within the iframe.

hope it is clear!!!
Yes i did..

In 2010 environment, the Excel webaccess Webpart is rendered in nested Divs and not in iframes. But still followed with the suggested approach, was able to change the taget window using javascript.

To my surprise even after changing the target window, the link is opened in new window instead of opening in specified window frame.

Below is code i used to change the target window.

<script language="javascript" type="text/javascript">
$( document ).ready(function() {
    $(".ewr-sheetcontainer").mouseover(function(){
              $(".ewr-sheetcontainer a").each(function(){
              $(this).attr('target','HeatMapV2_Frame');
              });
     });
});</script>
<div><iframe name="HeatMapV2_Frame" id="HeatMapV2_Frame"></iframe></div>
ASKER CERTIFIED SOLUTION
Avatar of ShyamSundarB
ShyamSundarB

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So it's working?
yes it's working now!!!
The code worked for me and it is the way we need to handle the EWA webpart in SP2010.