Discussion Locked

How do I print from a pop-up window?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to be able to print from the new window without using the file|print from the menu bar and do it with a link within the new window itself. HERE"S THE CODE:
order=window.open("","orderWindow","toolbar=no,width=550,height=500,menubar=yes,resize=yes,")
with (order.document) {
write("")
write("Customer's Rental Invoice-Amount Due!")
write("")
write("")
write("

Thank you for your business, "+custname+"

")
write("

Please remember, we will reserve the vehicle of your choice-if you call at least 2 hours in advance.")
write("

Listed below is your address and the total invoice amount of your auto rental. We accept cash, major Credit Cards, and checks drawn on local banks only!
")
write("

Street Address: "+ address+"
")
write("City: "+ city+"
")
write("State: "+ state+"
")
write("Zip Code: "+ zipcode+"
")
write("Customer Type: "+ custype +"
")
write("Beginning Odometer Reading: "+ startodread+"
")
write("Ending Odometer Reading: "+ endodread+"
")
write("Total Miles Driven: "+ totalread+"
")
write("Days Rented: "+ daysrented +"
")
write("Total Mileage Charge:$ "+ totmilechg+"
")
write("Total Usage Charge    :$ "+ totdaychg+"

")
write("Total Rental Charge   :$ "+ grandtotal+"

")
write("Close Window

")
Write("

") write("")
}

5 replies

by g_eigo

You could use th onload event of the body tag to call either a vbscript or a javascript proceedure to do the print. The body tag will look like this:

This will cause the print dialog to appear and the user can them print document. There is another way to to do this by using the browser object if the target browser is IE. But since the target browser is unknown I'll mention it and if you need specifics let me know.

by sachinp78

Hi
In the opened child window just call one event
i.e print().
It can be called on body load event
e.g (1) or

Or you can call
an event window.print() onclick of any gif or link on schild window

This discussion is closed to new replies.