473,714 Members | 4,452 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to print() one frame from another

Hello,

I have 2 frames. The top one is the control frame and the bottom one is
the display. I have a roll-over button in the top frame that I want to use
to do a print() for the bottom frame.
I tried having this JavaScript code when the roll-over button is clicked:
parent.frames[1].focus();parent .frames[1].print()

I am using Internet Explorer on Windows, and I am getting a print window
with "Only the selected frame" selected. But when I click the "OK" button
to tell Windows to print, it prints the top frame instead of the bottom
one...

I also tried putting this function in the header of the bottom frame, and
then calling it from the top frame:
function FramePrint()
{
self.print()
}

But it still likes to print the top frame...

Thanks,
Scott Navarre
Jul 20 '05 #1
4 6248
"Scott Navarre" <sm*@asus.net > wrote in message news:<bu******* **@enews4.newsg uy.com>...
I have 2 frames. The top one is the control frame and the bottom one is
the display. I'm doing a similar thing on a project i'm working on
I am using Internet Explorer on Windows, yep same here,
But it still likes to print the top frame...

Hmm, I get the same results, but I also tried on Mozilla,
Guess what, it worked like it should, bottom frame printed nicely.

The problem looks like another Microsoft 'feature'
(standards ? what stsndards?)

My resort - a bit messy, is to place a button on the page to be
printed and 'hide'it from the printer with css. If you detect a
compliant browser you can hide the button fully, or just don't being
display in the first place.

Have you made any progress ?

I'm going to try the Microsoft site.

Cheers

Ron.
Jul 20 '05 #2
: I tried having this JavaScript code when the roll-over button is
clicked:
: parent.frames[1].focus();parent .frames[1].print()

I have an iframe on my main page.
I use parent.window.p rint(); from the iframe.
That works in MSIE and NN/Moz.

: I am using Internet Explorer on Windows, and I am getting a print window
: with "Only the selected frame" selected. But when I click the "OK" button
: to tell Windows to print, it prints the top frame instead of the bottom
: one...

Maybe you want to open a new window with the frame and print that one?
Look at some lyric sites, they have print buttons for frame printing too.

Wouter
Jul 20 '05 #3
function PrintMain()
{

document.getEle mentById('conte nxtmenu').style .setAttribute(' display','none' )
;
if (document.all)
document.body.f ocus();
window.print();

document.getEle mentById('conte nxtmenu').style .setAttribute(' display','block '
);
}

Will print only the mainpage in my case.. when the childframe calls
parent.PrintMai n(); So the body is focused instead of the frame..

So frame[1].body.focus() might do the trick in your case?

Wouter
Jul 20 '05 #4
:
document.getEle mentById('conte nxtmenu').style .setAttribute(' display','none' )

replaced by
document.getEle mentById('conte nxtmenu').style .display='none' ;

NN/Moz gives it's OK too.
IE5+ needs a document.body.f ocus(); of the frame that needs to be printed.

Wouter
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9454
by: Marcus Bjorke | last post by:
I use a print link that causes a problem with Opera 7. The link looks like this <a href="javascript:parent.frames.mainFrame.print()">Print this page</a> I also used <a href="javascript:print()">Print this page</a> and it also worked with most browsers. I realize that it only works if you have Microsoft Windows versions for PC but that is what most of out customers have anyway. I have also noticed that there is a problem
2
7375
by: scrimp | last post by:
Well, Ive been searching through google groups and Ive seen a lot about printing a pdf file, but I havent seen a definite answer. I tried this code: f = open(printer_path, 'w') f.write(pdffile_path) f.close() Basically it doesnt work and what it prints out is the value of pdffile_path variable. If anyone can offer some help, Id appreaciate it
3
2076
by: dana lees | last post by:
Hi, I'm writing a C# asp.net web application. I have a frameset in which the upper frame contains a "print" button and the lower frame contains content of a different domain. Since i cannot call window.print() in another domain, i'm trying to trigger an event in my lower frame that will call window.print() itself... How can i do that?
8
3814
by: Veerle | last post by:
Suppose having a frameset consisting of two frames, both with dark background colors. One of the frames is a sort of menu and the other one contains the content. When someone clicks a menu item in the first frame, another page is loaded in the second frame. I know it is not a nice solution, but given this situation, is it possible to set the background color of the second frame, so that in between loading the pages with a dark background...
9
1452
by: jim-on-linux | last post by:
This is the situation I'm in. I've built a single file utility using py2exe. I zip the dist directory and send it to the client. For clients that use win95, win98 machines, They unpack the zip file and run the exe. The utility creates a text file that is sent to the printer with the statement below.
41
7613
by: Cartoper | last post by:
I hear it is possible to disable the web browsers print function, does anyone know how to do that?
2
1934
by: Carnell, James E | last post by:
I am thinking about purchasing a book, but wanted to make sure I could get through the code that implements what the book is about (Artificial Intelligence a Modern Approach). Anyway, I'm not a very good programmer and OOP is still sinking in, so please don't answer my questions like I really know anything. MY QUESTION: What is a slot? In class Object below the __init__ has a slot. Note: The slot makes use of a data object called...
1
1414
by: gayak | last post by:
Hi all, When I try to print a page. I am unable to do so. I get a javascript error as "Access is Denied". When I googled I found out that the script in one window or frame is trying to access another window or frame whose document's domain is different from the document containing the script. How to overcome this issue Please Advice. Many thanks in advance
3
30825
by: Tim | last post by:
Folks, I'm trying to format a print string so that it reports progress whilst processing a looping structure with a date time stamp appended to the end of the string. This started out life as a simple need to create a display that show progress to users when updating large tables in a data warehouse in real time. I have subsequently address that need through a different method, however I am challenged by the seeming impossibility to...
0
1696
by: helplakshmi | last post by:
I want to print a page from another page. I have a master page with links to other page. When I click "print," it should print the another page. The function window.print() is printing only the active page. So on click print i am opening a new window. In the onload event of the target page i have used <body onload="window.focus();window.print();window.close();"> Eventhough it's working, at the same time the window is also popping up...
0
8808
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8712
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9316
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9179
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5959
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3160
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2525
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.