Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto-switch the printer

Status
Not open for further replies.

gunjan1952

IS-IT--Management
Sep 9, 2015
1
SG
In my organisation, one specific software is running for Accounting on FoxPro.
I have to assign printers to accounting application, in such a way so that if any user is unable to print the receipt from current printer, the printing job will automatically switch to next available printer within 10-15 seconds and all printers should be listed in the accounting software.

I have already installed all printer's driver on the accounting server.
Thank you.
 
Can you clarify "unable to print the receipt from current printer", please ?
Because many things can happened that can't, or are too complicated to be programmed.

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
I would look at APRINTERS(), but bear in mind that it can be a painfully slow process
if printers are not available at run time.

Code:
IF APRINTERS(gaPrinters) > 0  
   CLEAR  && clear the current output window
   DISPLAY MEMORY LIKE gaPrinters && show the contents of the array
ELSE  
   WAIT WINDOW 'No printers found.'
ENDIF


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are not good for you.
 
One thing, I'm not sure how VFP would know a print had failed, other than looking in the print queue to see if it arrived and
left after a few seconds...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are not good for you.
 
Off-hand, the only way I can think of to determine "if any user is unable to print the receipt from current printer" is to trap "Printer not ready" errors. But, under Windows, those errors are mostly only triggered if there is a serious issue with printer drivers - such as no drivers installed. In a normal situation, a failure to print does not trigger an error.

Unless someone can come up with a better solution, I guess you are going to have to rely on some form of user involvement.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Like Griff says detecting a printer availability or print job success is not the core of VFP, I'd say you have better luck solving that feature request on the OS level with a sppoler software solution doing something like printer load balancing.

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top