Link to home
Start Free TrialLog in
Avatar of rifaquat
rifaquatFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Printing Records Directly To Printer

Hi

I have a situation where i have records on the webpage with the 'Details' button with every records which shows the details of every record and then it prints the record when you go into the detail.jsp page. I want to give an option on the existing page where you can print all the records to the printer directly from the database without going to the details.jsp of that record.
Avatar of bloodredsun
bloodredsun
Flag of Australia image

>>I want to give an option on the existing page where you can print all the records to the printer directly from the database without going to the details.jsp of that record.

You can't.

For security reasons, you do not have native access to the users system, including the printer. You can request that a page is printed by using the javascript command window.print() . You will need to use a JSP which connects to the database and retrieves the data and then generates the output, either as HTML which can be printed or as a PDF using something like iText or XSL-FO which can then be saved or printed.
Avatar of rifaquat

ASKER

We are actually using Hibernate for interacting with the database and Velocity Templates for presentation layer. Now, i want to print the data in the same format which is actually being shown in Details.jsp page but without actually going into the page I want to provide this service on one click and then it should print all the data to the printer(Client's Printer) one by one while taking all the records from the database on the server. I would appreciate your help if you can provide me some piece of code...Just the overview of business logic not the hibernate stuff.....etc..
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of bloodredsun
bloodredsun
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial