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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spooling delayed when printing from a Windows Client

Status
Not open for further replies.

dlpastel

Programmer
Aug 8, 2002
114
US
My Clipper program is running in a dos window on a Windows 98 machine. The printer is connected to a Windows 98 server. When I print a report in my Clipper program the only way to get it to spool to the server is to exit the program. I believe Windows is waiting for some type of End of Job indication. Is there something I can put in my code at the end of the print job to start the spooling? Otherwise I either have to exit the program or wait until the job times out. I already send a carriage return as the last print line and also use Set device to screen.

Thanks,
Dan
 
This was discussed before I guess, but haven't searched yet.

My solution was to treat the printer (\\server\printer) as a file, by just doing fopen() on that file, catch any errors in errorsys because the write-only-'file' can't be read back, (just tell it to continue...), write your printdata using fwrite() and when finished close that 'file' with fclose(). It will print immediately, the only delay being the laser to write your report on the drum, and the engine starting to rotate it off to the paper s-)

Yes, you'll have to replace all your ?... and @ ... say statements, with a functioncall that writes with fwrite(), and catches <FF> to reset the internal linecounter when using @ say, but after that big step, your users will love you B-) I had the advantage that most of my printing goes through my own report routines ;-), so one actions took care of almost everything, in most app's :eek:) It also makes life easy when you want to print to file.....

HTH, TonHu
 
May be very simple
Put at the end of the printer routine:

SET PRINT TO

That all

Regards from Málaga (Spain)

Alvaro
 
Not my own work but try this:

FUNCTION PRCOMMIT()
local cPrinter := set(24,&quot;LPT3&quot;)
set(24,&quot;LPT2&quot;)
set(24,&quot;LPT1&quot;)
set(24,&quot;&quot; )
// restores the original printer-port!
set(24,cPrinter,.t.)
return nil


Call it when you want to flush the printer Ian Boys
DTE Systems Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top