Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 printing labels using SQL as a base

Author  Topic 

smccreadie
Aged Yak Warrior

505 Posts

Posted - 2003-06-30 : 20:03:19
Not exactly a SQL question, but hoping someone has some experience.

We are developing a SQL 2K/IIS5/VB.net web application for managing investigation drug studies. The requirements are that the application print labels to a dedicated label printer (Zebra).

I'm trying to find some software that is installed on the web server that allows us to send the results of a sql statement to it that will do TCP/IP based printing to the Zebra. Anyone had to do this before? It doesn't have to be free. Because this app is going to be used in a controlled desktop environment, I want it to be completely server based.

Thanks

X002548
Not Just a Number

15586 Posts

Posted - 2003-06-30 : 20:19:28
I image you could write a sproc using com objects and print them using Word...

Never done it though...

Look up COM in BOL

Does it have to be on demand or scheduled?



Brett

8-)
Go to Top of Page

smccreadie
Aged Yak Warrior

505 Posts

Posted - 2003-06-30 : 20:49:38
Has to be on demand. Word option won't work because these aren't normal windows printers - they're industrial thermal printers designed for high use and barcodes and everything else.

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-06-30 : 22:46:55
That may be, but if there is a Windows driver for those printers, you can use them with Word a helluva lot more easily than doing it from a web page. The printer doesn't care what program is actually sending it bits and bytes, it only knows to print them. Word will give you far more reliable formatting and quality of print that a web page would.

If you HAD to, you can invoke an MS Word application as a COM object, populate a Word document with the proper content for printing, and invoke its methods to actually print the document automatically, and it should work from an ASP page. I strongly suggest making this a LAST resort, because you can easily swamp your IIS server's memory by creating Word COM objects.

Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-07-01 : 04:33:11
Have you seen these:
http://www.zebra.com/SD/demos.htm

The last time I wrote something to print to a barcode printer (was a long time ago!), I simply used a formatted text file and sent the file onto the printer port from DOS. Printed perfectly each time. The file contained various formatting codes and the data to be printed in a specific format that I obtained from the printer manual. I dont think this should be difficult to do from IIS or SQL Server.

- Create a text file
- Fill it with data and formatting codes
- Call a batch file to send file to printer (TYPE file.txt > COM2)

I cant seem to find those files, I'll post more details when I get them.

Owais

Go to Top of Page

smccreadie
Aged Yak Warrior

505 Posts

Posted - 2003-07-02 : 21:25:34
Yes, I saw the info for BarOne and sent an e-mail to the company for more information. I also talked to someone who used BarOne with FoxPro in a client-server app and got it to work pretty well. Let me know if anyone else has experience with this.

I agree that I want to avoid Word com objects. That's a bit out of my programming comfort zone and I don't want to deal with memory issues.

Go to Top of Page

Andraax
Aged Yak Warrior

790 Posts

Posted - 2003-07-03 : 02:11:10
With Office XP, the memory problems are quite managable. I have used word and excel from both ASP and SQL Server (sp_OA*). But I agree it's not the most reliable solution out there.

If this is an industry type, non-standard printer, then maybe they have an API or something of their own that you can use?

Go to Top of Page
   

- Advertisement -