I have a SSRS report that has a hyperlink to another website. The link to the site works fine when I access the report directly. However, I am displaying the report in an iFrame. When I click on the link within the iFrame, nothing is happening. I can copy my link, paste it into another window and I am able to see the link work.

Here is my link:

=iif(Fields!budgetid.Value>1,"javascript:void(window.open('"+"http://test/forms/Su....aspx?BudgetId=" & Fields!budgetid.Value & "'))","")

code for my iFrame:
<iframe name='myIframe' id='myIframe' src='http://reports/Repor...t=my_htmlviewer' height='650' width='100%' scrolling='auto' frameborder='0' ></iframe>

I've gone over the javascript syntax and I know that this is working for me. It just feel that maybe the iFrame is somehow "blocking" the link from working? I have seen the Sandbox attribute that was added, however that looks like it is only supported in IE10 and up, and we are below that. Thoughts? Thanks for the help.

jamey8420

Member Avatar

LastMitch

I've gone over the javascript syntax and I know that this is working for me. It just feel that maybe the iFrame is somehow "blocking" the link from working? I have seen the Sandbox attribute that was added, however that looks like it is only supported in IE10 and up, and we are below that. Thoughts? Thanks for the help.

What does it has to do with html & css? The issue you have is more related to javascript than css. I'm look at this issue on here:

=iif(Fields!budgetid.Value>1,"javascript:void(window.open('"+"http://test/forms/Su....aspx?BudgetId=" & Fields!budgetid.Value & "'))","")

You never mention anything about how to open the link? is it in the a parent or child?

or another words you want open in the iFrame or within the iFrame?

Is javascript not displaying the link?

Are you trying to display data from the database through the iFrame?

If you had post this issue in javascript I would explain in the javascript but since you post this in CSS I'll only mention CSS:

There's nothing wrong with this code here:

<iframe name='myIframe' id='myIframe' src='http://reports/Repor...t=my_htmlviewer' height='650' width='100%' scrolling='auto' frameborder='0' ></iframe>

It might be related to the base:

http://reference.sitepoint.com/html/base

LastMitch,
Thank you for your thoughts. To clarify what I'm doing:

I have a SSRS report that is rendered within an iFrame. The SSRS has a link to another website on it (the link above) which I would like to open in a new window (not in the existing iFrame). The link is within one of the columns of the report, and would be activated when I click on it. The javascript is displaying the link (when I hover over that column, the little hand pops up.) But when I click on the link, nothing happens. If I right click, copy the shortcut and paste into a new browser window, the link works.

That is why I had posted within the HTML. Upon my reading, I found some information about iFrames not allowing scripts to be run (the sandbox attribute that was added for HTML 5 seems to solve that problem). However, on browers that are not combatible with HTML 5 is there any work-around?

jamey8420

Member Avatar

LastMitch

That is why I had posted within the HTML. Upon my reading, I found some information about iFrames not allowing scripts to be run (the sandbox attribute that was added for HTML 5 seems to solve that problem). However, on browers that are not combatible with HTML 5 is there any work-around?

Well, I'm not going to post anything since you open an new thread here:

http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/453652/window.open-from-iframe-doesnt-appear-to-work

In the future, try not to open 2 threads with the same issue and it's also rude if someone is trying to help you already.