RE: Programming help for a print function

2008-11-06 Thread Gundersen, Richard
I've just done the same thing - although it's nothing to do with Struts var a = window.open('','','width=500,height=400'); a.document.open(text/html); a.document.write(document.getElementById('receipt').innerHTML); a.document.close(); a.print(); a.close();

Re: Programming help for a print function

2008-11-06 Thread Alberto Flores
Are you aware that you can control what is printed with CSS (media=print)?. This is a good trick (depending on what you are trying to do). Only food for thought! Guojun Zhu wrote: Hi, I am new to struts and using Struts 1.2.9 (old version, but not my decision). I have a view page in jsp

Re: Programming help for a print function

2008-11-06 Thread Guojun Zhu
Thank you very much. That works for me. I changed the media type to text/plain and forward what is in the textarea directly and it works fine in IE and firefox. (some format problems in Opera though, need to check safari later). Have a great day! sincerely Zhu, Guojun On Thu, Nov 6, 2008 at