user4639776
user4639776

Reputation:

How to print directly in asp.net mvc

I'm developing application with asp.net MVC Technology its a inventory application i have done some printing options including bar code but i cant print directly im using window.print. when fire this function chrome will show another popup(default web printing popup) for print. then again i want to click print then only i can print. Our client not ready to do something like that.is any other way to print directly or can i go with java script

I have tried JavaScript. Window.print()

Upvotes: 0

Views: 1791

Answers (1)

monstertjie_za
monstertjie_za

Reputation: 7803

As I cannot comment yet, I need to post this as an answer.

If you have a barcode that needs to be printed when a new 'Stock Item' is created, I would have maybe have taken the following approach:

  1. Create a Database table responsible for holding print jobs, for instance tblPrintQueue
  2. You will have a service, for instance, a windows service created by you in C#, running in the background, observing the tblPrintQueue, and when a new item has been placed in the table, the service will automatically grab it and print it.
  3. Update your item's status in the tblPrintQueue to say it has been printed.

Creating connections to printers, if they are network printers, are really not that hard to connect to, a simple TCP connection with the Port would do the trick.

I have done this approach before with Inventory Management Systems, and it really helped in our scenario.

Upvotes: 1

Related Questions