| Author |
Printing Jasper Reports in Local and Network Printer
|
Anant K Agarwal
Greenhorn
Joined: Mar 01, 2012
Posts: 9
|
|
Hello Ranchers,
I have a web application running using Struts2 framework. The requirement is
a. User's perform various transactions.
b. Each transaction needs to be printed.
c. Each transaction has a jrxml attached to it (configured using a property file).
d. Once the user completes the transaction, print should happen seamlessly.
Printing can be done in two ways.
1. If a Network printer is configured for that particular user and the transaction, the print will be fired in that particular network printer.
2. If a Local Printer (attached to the desktop) is configured for the user, the print should be fired in his local printer.
I have achieved the first part (network) printing using Java Print Services. But need a solution around the local printing requirements.
For local printing, once the user completes the txn, the report should be printed to his local printer, without any user intervention.
User may have more than one printer installed to his local machine, based on the txn type routing will happen to the appropriate local printer.
Any help or suggestions would be of great help.
|
 |
Luan Cestari
Greenhorn
Joined: Feb 07, 2010
Posts: 29
|
|
The only way you could achieve the printing part is with an applet running in the client. To be the most seamless, I would make the applet not visible and using JSObject (http://docs.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html) I would make the authentication only be possible if the user authorize to the applet to run. To make the communication between the server side (Servlet/Struts2), you need to pass the session id as parameter to the applet. Another problem that you could face using the Java Print API is if the printer is available and can print the file you want.
Best Regards,
Luan
Anant K Agarwal wrote:Hello Ranchers,
I have a web application running using Struts2 framework. The requirement is
a. User's perform various transactions.
b. Each transaction needs to be printed.
c. Each transaction has a jrxml attached to it (configured using a property file).
d. Once the user completes the transaction, print should happen seamlessly.
Printing can be done in two ways.
1. If a Network printer is configured for that particular user and the transaction, the print will be fired in that particular network printer.
2. If a Local Printer (attached to the desktop) is configured for the user, the print should be fired in his local printer.
I have achieved the first part (network) printing using Java Print Services. But need a solution around the local printing requirements.
For local printing, once the user completes the txn, the report should be printed to his local printer, without any user intervention.
User may have more than one printer installed to his local machine, based on the txn type routing will happen to the appropriate local printer.
Any help or suggestions would be of great help.
|
See more: superseniordevelopers.blogspot.com luancestari.blogspot.com
"By a lie, a man... annihilates his dignity as a man." - Immanuel Kant
|
 |
 |
|
|
subject: Printing Jasper Reports in Local and Network Printer
|
|
|