Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Does anyone know how to send a print job to printer from asp webforms. i am working on a project of school fee system. i want to print a fee voucher of all the class or school or any search criteria or sometime a single student? For example its starting of month and i am printing whole school fee voucher or i search a student of class III or student whose name start with 'A' and i got a result of 3 pages and i want to print voucher of my search result then how to send a print job. any help would be highly appreciated

What I have tried:

In this scenario i am using dt to store search result or students record any better idea to do this task?
Posted
Updated 2-Sep-16 5:00am
Comments
F-ES Sitecore 2-Sep-16 4:21am    
I'm going to assume that like most people asking about printing from asp.net that you want to print on the client's printer. If that's the case then you can't. The user will need to select to print whatever document you show them in the browser using the browser's print button.

1 solution

You might use that information: CSS Print Media Query | Styling the Printable Version of your Site[^].

Thus with CSS, it is possible to make some adjustment for printing.

Another possibility is for the server to generate some printable documents (often PDF), that the user can download and print. Many web site will do it that way.

As indicated in a comment, it is not possible to automatically print as otherwise it would be possible for spammer to print lot of stuff when you visit their sites. Thus for security reason, printing has to be explicitly asked by user through web browser UI. If printing was allowed, then it would probably be almost has bad has advertising on some web site...
 
Share this answer
 
Comments
Richard Deeming 2-Sep-16 12:00pm    
Almost as bad?! At least the adverts on screen don't use up five trees and fourteen ink cartridges printing out details of how to enlarge parts of my anatomy! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900