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..
ShyamSundarBAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tbsgadiCommented:
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
0
ShyamSundarBAuthor Commented:
@ 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!!!
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

ShyamSundarBAuthor Commented:
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>
0
ShyamSundarBAuthor Commented:
Got a Hang on this!!!

In the above posted code, instead of setting the target attribute of <a> assigned a Onclick event to each <a> and called a javascript function.

Inside this function, explicity changed the target, but still wondering why it didn't work with the above posted code.

Working code :

<script language="javascript" type="text/javascript">
$( document ).ready(function() {
$(".ewr-sheetcontainer a").each(function(){
      $(this).attr("onclick","openLink(this)");    
    });
});
function openLink(Atagproperties)
{
  Atagproperties.target = "_self";
}
</script>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tbsgadiCommented:
So it's working?
0
ShyamSundarBAuthor Commented:
yes it's working now!!!
0
ShyamSundarBAuthor Commented:
The code worked for me and it is the way we need to handle the EWA webpart in SP2010.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.