Forums Register Login

Printing a web page using the Printable class

+Pie Number of slices to send: Send
Hello Friends,

I am currently creating a reporting application. One of its features include being able to print the report page in a printable format. Now, our client wanted to eliminate the annoying printer settings UI that comes out everytime we use the window.print() javascript command to print a webpage. So in order to eliminate this, we resorted to using Java's Printable Interface in which we would just enter the Report Page's URL and let it to the print job without having the print settings UI to pop up. The print button at the Report Page would now call a Servlet which would then call the class which implements the Printable interface.

Now the Problem is,

The URL of the report page that we would like to print is eg. (http://localhost:9080/MyApp/PrintReportPage.do) which is a Struts link. If we input that exact url in the class that implements Printable, we could not print the report page the way we like it since THE SESSION ALWAYS TERMINATES. The page containing the error "session was terminated" was printed instead of the Report Page.

Is there any way to solve this type of problem?
[ August 02, 2006: Message edited by: aj delr ]
+Pie Number of slices to send: Send
Ahem, you are aware of the fact that the servlet would print on the server side, not on the client side?
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 951 times.
Similar Threads
Printing an object
Capturing the current window's cotents?
Object Reference Conversion
Super ref = new Sub();
Retries is Java printing?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:14:40.