File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Printer friendly option in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Printer friendly option in javascript" Watch "Printer friendly option in javascript" New topic

Printer friendly option in javascript

Kannan BLR

Joined: Mar 01, 2005
Posts: 10
we craeted a JSP page report. getting values from database & displayed the values as a report in JSP Page. "print" option of this page is not printing entire report using javascript code like window.print().

when i click "print" hyperlink text, entire report will open in new page where i should use print preview for that page.

please give suggestion to me.

Kannan.A<br />
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

"Kannan", please check your private messages.

[Asking smart questions] [About Bear] [Books by Bear]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Need to use and on the onload of that page you call window.print()


You can look into CSS Print Media

Steph Sam

Joined: Dec 09, 2007
Posts: 15
[Content removed: please do not post the same question in more than one place]
[ January 21, 2008: Message edited by: Bear Bibeault ]
I agree. Here's the link:
subject: Printer friendly option in javascript
It's not a secret anymore!