views:

177

answers:

4

We have a requirement to auto print dockets from a webpage.

We are developing a stock control application using ASP.NET, MVC2 using IE6

Scenerio is as follows:

Once the user has completed the order, a docket should be automatically printed. At the moment, I am using Javascript command "window.print();" method however the print dialog button is displayed.

Is there a way to stop the print dialog button from showing and the docket will be automatically printed?

+2  A: 

Nope, this is related to browser and you can not print directly. You need to press the Print button on that dialog box.

Sarfraz
A: 

I found this. It is probably what you need. It has solutions for silent-printing in both IE and Firefox. However it always requires the user to tweak his browser settings. This is so that web pages you visit don't automatically silently send print commands to your printer.

P.S. this would make a very nice prank!

stagas
Stages, thanks for the link, where I am currently contracted to, a government organisation and the machines are locked down, it is not easily accessible to the browser settings, You have to put in a request form etc joys of the bureaucratic process.
Richard
You need to fill that request form to tell them to change browsers cause IE6 and that government data are vulnerable.
stagas
+3  A: 

No way to do this directly, but if you install an ActiveX control (in other words, run your own code in the browser), then you can do whatever you want.

Note that Microsoft is strongly discouraging the use of IE6. Here's part of the campaign which compares IE6 to 9 year old milk.

jdigital
A: 

I don't think there's any way to prevent the print dialog box in the browser.

If you could make it so that your web app could create files on an internal network file server, then the file server could be set up to print any files dropped into its directory. There appear to be some software solutions for this second half: http://www.google.com/search?q=automatically+print+file+in+directory

KatieK