• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing the contents of a JSP....

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to provide print functionality in my JSP. There should be a print button and when the user clicks this 'print' link/button it should pop-up a new window with the contents from the parent window.
I can pop-up the new window, but the problem here is I could not pass a java bean object to this window in order to display my contents on the new window.
I cannot print the contents of parent window directly, because the data is being displayed in the area with scrollbars (created using <div> tags).
Does anybody have a solution or sample code for this?
Thanks much.
--
Sailu
[ February 09, 2004: Message edited by: Bear Bibeault ]
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is achievable through Javascript itself somethink like window.print()
Scroll bar should not be a concern as long as the content can fit on a normal size paper...I don't the use of opening a new window
 
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by AnilKumar:
This is achievable through Javascript itself somethink like window.print()
Scroll bar should not be a concern


Scroll bars will create problem, if they are formed using DIV tags. Try it.
Sailu,
I don't understand what is the problem with accessing a Java bean object from the new window! Are you getting some errors?
 
reply
    Bookmark Topic Watch Topic
  • New Topic