Solved

Printing To Network Printers From ASP .Net Application

Posted on 2002-07-11
6
353 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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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