Help with printing pcl codes to local printer using RDP/Term

Posted by wmatthews on 12-Mar-2010 10:11

Hi everyone,

We are in the process of testing Windows 2k8 Terminal Services for our Progress application and we have encountered an issue when sending print jobs to the client/local printer.  We have historically printed using the standard Progress "Output to Printer" style however it appears within Win2K8 the client default printer is no longer available to us.  Can anyone recommend a better or best-practices approach to printing Progress-built print reports within a Terminal Services environment?  We have tried using the "osprint.p" tool but and it actually works just fine with one exception - all of our embedded PCL escape codes are sent to the printed page and no interpreted by the printer.

Any suggestions would certainly be appreciated.

Wayne.

All Replies

Posted by cworks on 01-Nov-2010 08:59

Did you get an answer to this?  Your support request is EXACTLY the same as mine.

I have successful programmed a LOT of functions, including ejects and such, BUT, I can't get the page length (depth) to work at all.  It still breaks when it wants to.

I am going to send another request with my page problem but if you have any information, please let me know.

Oh, below is the standard code I use to send output to laser printer.  I put this block in all my code and then comment out the stuff I don't know on any particular report this way I have what I need automatically if I have to go back and add something like a change in paper size:

        /* Once output stream is set to selected printer, send these PCL commands
           to setup the format/layout of the page */

        PUT STREAM formsprint CONTROL "~033E".       /* RESET  */
        PUT STREAM formsprint CONTROL "~033(s3T".    /* Select Font: Courier */
        PUT STREAM formsprint CONTROL "~033(s0P".    /* Select Font type - FIXED */
        PUT STREAM formsprint CONTROL "~033&l8D".    /* Set lines per inch */
        PUT STREAM formsprint CONTROL "~033&l58P".   /* Page length in lines */
        PUT STREAM formsprint CONTROL "~033&l2E".    /* Top Margin = 2 line  */
        PUT STREAM formsprint CONTROL "~033&l80F".   /* Text length  */
        PUT STREAM formsprint CONTROL "~033&l1O".    /* Landscape  */

        /* Now, examine the paper size setting and with consideration of the column count, afix the
           font size.  These suppported font sizes were determined by trial and error on 10/18/2010
           and certainly more combinations could be supported
        */
       
        IF paper_size_combobox:text = "Tabloid (11 x 17)" AND job_columns:text = "5"
            THEN
        DO:
            PUT STREAM formsprint CONTROL "~033&l6A".    /* Select 11x17 TABLOID: Ledger Size Paper */
            PUT STREAM formsprint CONTROL "~033(s12H".   /* Select Font Pitch in char/in H for fixed font, V for variable in pts */
            ASSIGN vPage_size = 56.  
            PUT STREAM formsprint CONTROL "~033&l55P".   /* Page length in lines */
        END.

        IF paper_size_combobox:text = "Tabloid (11 x 17)" AND job_columns:text = "4"
            THEN
        DO:
            PUT STREAM formsprint CONTROL "~033&l6A".    /* Select 11x17 TABLOID: Ledger Size Paper */
            PUT STREAM formsprint CONTROL "~033(s10H".   /* Select Font Pitch in char/in H for fixed font, V for variable in pts */
            ASSIGN vPage_size = 56.
        END.

        IF paper_size_combobox:text = "Legal Size"
            THEN
        DO:
            PUT STREAM formsprint CONTROL "~033&l3A".    /* Select 11x17 Legal Size Paper  */
            PUT STREAM formsprint CONTROL "~033(s12H".   /* Select Font Pitch in char/in H for fixed font, V for variable in pts */
        END.

        IF paper_size_combobox:text = "Letter Size"
            THEN
        DO:
            PUT STREAM formsprint CONTROL "~033&l2A".    /* Select 11x17 Letter Size Paper  */
            PUT STREAM formsprint CONTROL "~033(s12H".   /* Select Font Pitch in char/in H for fixed font, V for variable in pts */
        END.

Keith Lamb

IT Manager

Commercial Works

Columbus, OH 43221

614.851.4233

Posted by cworks on 01-Nov-2010 09:24

To more specifically reply to your request, I present all outputs in a common user dialog that I wrote.  It has a screen icon and a printer icon.  I actually have a printer-device table in the database which lists each printer and its attributes one of which is type and it tells me whether its dot matrix or laser type, then within laser type page description lang is asked for, namely POSTSCRIPT OR PCL.  Here is the command I issue in Progress depending upon which printer the user selects using a combo-box:

       
    OUTPUT stream formsprint to printer value(branch.report-printer-id).

This resets the default printer for this session to the one indicated.  Its just like doing a right-click in the printer menu on windows and changing the desired printer to be the user's default.  Its just temporarily and just for this session.  Works great, EXCEPT, the naming convention has to be very consistant.   That's if you do client-server - if 100 users need access to "Okidata1" then they all have to be named that way on each PC.  Its stinks.  You should be able to user an IP address so a UNC (universal naming convention) can be used.

Terminal Server makes this TONS easier.  Everyone can access the printer list on that server - just like a PC this list is specific to this server and they don't have to be on that server - just available to it.   BUT the Progress program must know the exact name of the printer you wish to set for your session.

Earlier I sent you a series of PCL commands in progress to do normal stuff.  I'd love to trade commands with you.   My problem is pagination.   I can't get it to page where I want.  Progress's old "PAGE" command does not work.  You have to send PCL to get the eject.  I think it really stinks that Progress won't do a simple eject on a common laser printer, but there you have it - it just prints literally the control L that the old dot matrix printers used to use.  BUT, the real problem isn't that I cant get it to obey my new literal eject PCL command...that does work....the real problem is that the printer still tracks its own line counter and it ejects when near the end of the page no matter what I do.  So it ejects early...then prints ...

heck, here's the sequence, which I cannot get to change, even if I change the #lines per page:

  Prints first 50 or so lines.

  Printer does an eject on its own...PAGE 2

  Several more lines print and then my eject occurs...now on PAGE 3 when only 3 or 4 lines printed on page 2...

  Prints even less than PAGE 1 and then printer again ejects onto PAGE 4...

I just want to shut off the printers PCL internal pagination.  I want MY pagination to be the only one.  I will track line counts and do so and I will send eject and header lines.

Maybe this has something to do with skip-over-perf?  Or some other over-riding page depth settings of some sort?

Keith Lamb

Columbus, OH

klamb@commercial-works.com


               

This thread is closed