Problem using _osprint.

ron

Member
We have a Web Client Ap that needs to print on the default client printer.

Using a command like this:

PUT STREAM prn CONTROL(CHR(27) + CHR(77) + CHR(18)). /* 12 cpi */

... worked fine for setting font-size, etc. However, if there was a printer problem the user would get an endless number of printer error messages on the screen.

The program was changed to output to a file - and then print the file with _osprint. This solves the multiple errors on failure problem ... but now the printer ignores the control characters!

Can anyone suggest a way to get the control characters through to the printer, using _osprint?

Thanks,
Ron. :drink:
 
ron said:
Can anyone suggest a way to get the control characters through to the printer, using _osprint?

No it cannot be done via _osprint. See below the article from Progress KnowledgeCentre:

--------------------------
Progress Solution


ID: P17233
Title: "adecomm/_osprint.p does not support printer control escape sequences."
Created: 10-Jan-2003 Last Modified: 2-Feb-2003
Status: Unverified

Goal(s):
• The adecomm/_osprint.p utility does not support printer control escape sequences?


Known to occur in:
• Windows


Fix:
adecomm/_osprint.p is a windows based print utility based on a Progress developed .DLL designed to to give some user flexibility for the user while printing a text file. The flexibility offered includes the choice of the font, whether to have a printer setup dialog or not, etc.

It does not offer the capability of sending printer control escape sequences to the printer. To do that from window, one would need issue special windows API calls that are not included in the _osprint.p utility.

Therefore, to send printer control escape sequences to the printer, use the Progress 4GL OUTPUT TO PRINTER statement, issue the appropriate windows API calls directly from your 4GL application, develop your own customized .DLL or use an already existing third party .DLL that has the desired capabilities.

--------------------

I use standard Output to Printer command and send Esc seq. I don't use API or .DLL. So far I don't get error messages like you do - maybe because my apps (V9.1D) is not in deployment yet and is a standard Windows application (not Web client). What kind of error messages are you getting on the screen ?


Regards
Skc
 
Skc said:
No it cannot be done via _osprint. See below the article from Progress KnowledgeCentre:

--------------------------
Progress Solution


ID: P17233

Therefore, to send printer control escape sequences to the printer, use the Progress 4GL OUTPUT TO PRINTER statement, issue the appropriate windows API calls directly from your 4GL application, develop your own customized .DLL or use an already existing third party .DLL that has the desired capabilities.

--------------------

I use standard Output to Printer command and send Esc seq. I don't use API or .DLL. So far I don't get error messages like you do - maybe because my apps (V9.1D) is not in deployment yet and is a standard Windows application (not Web client). What kind of error messages are you getting on the screen ?


Regards
Skc

Thanks for the reply. I don't know how I missed the Solution you quoted (P17233) ... I searched the Knowledge Base and found several references to _osprint - but not that one!

The program originally used OUTPUT TO PRINTER statements ... and worked just fine. However ... if the printer happens to be unavailable the user has to acknowledge many error messages saying the printer is unavailable. I haven't counted the number of messages ... but it exceeds 30. However there are only four OUTPUT statements to print a docket - so an error message must get generated for each individual print line.

We tried _osprint as a way to "contain" the problem to (say) just one error message. The 30+ messages we get now is far too many ... and will lead the users to do "nasty" things like CTRL-ALT-DEL.

If OUTPUT TO had a NO-ERROR option it would solve our problem - because we could know after the first OUTPUT that we're unsuccessful - and we could abandon. But we can't.

Ron.
 
ron said:
The program originally used OUTPUT TO PRINTER statements ... and worked just fine. However ... if the printer happens to be unavailable the user has to acknowledge many error messages saying the printer is unavailable.
Ron.


When you say 'unavailable' I assume you mean the printer is Offline. I have done a rough test on my XP standalone PC, switch off the HP Deskjet printer and did a print that sends Epson-compatible 17cpi control sequence (haven't got time to change it to HP's 17cpi). No error message appeared.

Check the HP print queue - it was in there. Switch on the HP printer and out comes the output - quite normal. My client is Progress prowin32.exe V9.1D. Appears to work fine.

Perhaps you could give more info like what is your OS? Progress Version. Printer-type. USB port, parallel port or Network printer?


Regards
Skc
 
Back
Top