Printing To Network Printers From ASP .Net Application

Is there any information or directions on how to  configure a printing environment with ASP .Net as the intended programming language? I understand there are some issues related to the default ASPNET account,changes to machine.config, user permissions, etc. I'd like info on what is required on IIS,Active Directory,IP protocol Printing. I simply want to print data retrieved from a dataset to a network printer from an ASP .Net web form. Any lead will be greatly appreciated.
Who is Participating?
naveenkohliConnect With a Mentor Commented:
I think you will need to use PrintDocument class to make this work. Althugh this is for WIndows forms application but with little bit of cutomization you should be able to work.

The whole idea is to have the text in StreamReader class and then associate that streeam with PrintDocument class. The problem will be that you will have to know the printer settings before hand to set the default settings. On server side you can't invoke the select printer or page setup dialog box. You should be able to get rid of the print event handlers from the code. In the document ation there is a nice sample "SamplePad" for printing demo. It should be a good starting point. Here is a small code snippet from documentation.

dxrodelaAuthor Commented:
Thanks for the info. I understand the process but still unfamiliar with the StreamReader,PrintDocument classes. However, I will pursue this direction. But, you stated, "In the documentation there is a nice sample", mentioning "SamplePad" demo. Where is the demo located?
Also, I'm assuming all I need to do is configure my printers on my server,request the user select a network printer(I'll provide a list on a form),and send my PrintDocument object to the selected printer. Please clarify any details I've missed. Thanks.
>>Where is the demo located?
Look in Help files under PrintDialog Class -> samples
IT Degree with Certifications Included

Aspire to become a network administrator, network security analyst, or computer and information systems manager? Make the most of your experience as an IT professional by earning your B.S. in Network Operations and Security.

In case you didnt have the code for enumerating printers:

"Enumerating the VB.Net Printers Collection"
dxrodelaAuthor Commented:
Thank you AzraSound. I'd give you pts too, but naveenkohli had the first lead. I'm studying the code now and can see it will be very helpful in many ways.
You will have to be very careful with this implementation. You can't leave any detail or selection to be made through dialog box raised on server. Otherwise your application will hang.
Azra has provided you nice reference to enumerating printers. Other than that if you follow the "SamplePad" example, I am sure that you will be able to accomplish it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.