Results 1 to 4 of 4

Thread: Printing Receipt Upon Row Insert (xp_cmdshell?)

  1. #1
    Join Date
    Jul 2004
    Posts
    2

    Printing Receipt Upon Row Insert (xp_cmdshell?)

    Hi All,

    I'm building a quick and dirty SQL/IIS application and I need to have the server print a 'receipt' page whenever a record is submitted from one of several workstations. I am looking for good ways to do this. The receipt will need to have custom fonts (barcodes). Anyone have any suggestions? Reliability is key.

    Thanks!

    alfa

  2. #2
    Join Date
    Sep 2002
    Location
    Montreal
    Posts
    86
    Hi, how about to create a print queue table. Once a record is inserted into your main table a trigger inserts a record with all the print properties and data you need to print a receipt into the Queue Table. Then you have a separate workflow print job that checks the table for the new records every 5 mins (per say) and print the new receipts accordingly. This way your transactions are going to be safe and if there is a problem with a printer you will be sure you won't loose any printouts cause of the table will keep all the pending jobs.

    Regards
    Dim

  3. #3
    Join Date
    Jul 2004
    Posts
    2

    Post Need Faster Printing

    Hey Dim,

    That was what I was thinking, except that I need it to print as quickly as I can. I was thinking about a stand-alone VB application, but am not sure how to pass the message from SQL to the application, other than the rudimentary 'look for a text file' method.

  4. #4
    Join Date
    Sep 2002
    Location
    Montreal
    Posts
    86
    well you have to compromise the print speed vs the application safety and data integrity. And I'm pretty confident that execut xm_cmdshell within a transaction is not a good idea. The error handling could be too crazy. What is there is no paper, no connections, lost connection during printing there are 1000 cases that should be taken care of...

    Decreaze the polling interval to 1 min, then it will be almost instant.

    Dim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •