View Single Post
  #3 (permalink)  
Old 11-13-06, 05:58 PM
King Coder King Coder is offline
Community VIP
 
Join Date: Jan 2006
Posts: 703
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by mike.whay
Hi

I have a .JSP program whixch generates on screen a report, this is called from a button on another screen. Works fine but what I would ideally like is for the report to be printed straight away to the default printerrather than having to show it on screen and then use IE print fucntionality

Thanks

Mike
I think adding JavaScript to your page would be the best solution. Messing with the Java printing API's is probably overkill. Use this javascript function:

Code:
<script language="JavaScript">
   if (window.print)
   {
      window.print()
   }
</script>

Let me know if does/doesn't work.
__________________
my site
Reply With Quote