Solved

Printing To Network Printers From ASP .Net Application

Posted on 2002-07-11
6
350 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now