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

Printing Contents of Iframe

Status
Not open for further replies.

JSMoose

Programmer
Mar 6, 2005
7
US
Hello,

I am trying to print the contents of 2 Iframes...Sounds simple. When the page prints the result is the label text ("Please wait. Search is being processed ...") and 2 empty boxes.

It seems like I have tried everything and have had no luck.

Any help would be greatly appreciated.

Thanks,

JSMoose

Source code:

<HTML>
<HEAD>
<title>Querying for Search Results</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="
<SCRIPT LANGUAGE="JavaScript">
function LoadIframes()
{
var ifrm = document.getElementById('ifrmSDN');
ifrm.src = "
var tmpifrmOFAC = document.getElementById('ifrmOFAC');
tmpifrmOFAC.src = "
window.print();

window.close();
}
</SCRIPT>
</HEAD>

<body MS_POSITIONING="GridLayout">

<form id="Form1" method="post" runat="server">

<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" runat="server" Font-Size="Large" Width="416px">Please wait. Search is being processed ...</asp:Label>
</form>

<!-- This is the iframe to load the SDN List Results-->
<iframe id="ifrmSDN" name="ifrmSDNListResults" width="500" height="500" style="Z-INDEX: 102; LEFT: 16px; VISIBILITY: visible; POSITION: absolute; TOP: 136px"> </iframe>

<!-- This is the iframe to load the OFAC Results-->
<iframe id="ifrmOFAC" name="ifrmOFACResults" width="500" height="500" style="Z-INDEX: 103; LEFT: 16px; VISIBILITY: visible; POSITION: absolute; TOP: 648px"></iframe>

<INPUT id="btnTest" title="Test Print" style="Z-INDEX: 104; LEFT: 104px; WIDTH: 96px; POSITION: absolute; TOP: 96px; HEIGHT: 24px" type="button" value="Test Print" onclick="LoadIframes()">

</body>
</HTML>
 

Unless you are using NN4 which has quirky print behaviour for dynamic content (you've not said which browser you are having problems with), I'd try asking in the CSS forum about print style sheets which give the iframes non-absolute positions.

Hope this helps,
Dan


The answers you get are only as good as the information you give!

 
BillyRayPreachersSon,

Thanks for your response. The browser is IE6.

Should window.print(); print the contents of the iframe in IE6 vice the outline of the iframe?

Thanks,

JSMoose
 

You should get the contents, but it depends on what those contents are, and how they are laid out.

As I said - you might want to ask this in the CSS forum.

Dan


The answers you get are only as good as the information you give!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top