Solved

Printing To Network Printers From ASP .Net Application

Posted on 2002-07-11
6
352 Views
Last Modified: 2010-04-14
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.
0
Comment
Question by:dxrodela
  • 2
  • 2
  • 2
6 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 100 total points
ID: 7146955
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.

0
 

Author Comment

by:dxrodela
ID: 7147005
naveenkohli,
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.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 7147065
>>Where is the demo located?
Look in Help files under PrintDialog Class -> samples
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 28

Expert Comment

by:AzraSound
ID: 7147078
In case you didnt have the code for enumerating printers:

"Enumerating the VB.Net Printers Collection"
http://www.aspalliance.com/jeffwids/articles.aspx?105
0
 

Author Comment

by:dxrodela
ID: 7147097
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.
0
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7147104
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.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question