ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Printing two overlays on the same printer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Printing two overlays on the same printer

    Greetings, we are trying to print a report with two pages. Each page has its own overlay, and so far we have been unable to print both of them in the same printer file using FRONTOVL and BACKOVL.

    We have a simple program that uses O specs and a CL that calls this program that does the FRONTOVL and BACKOVL in a OVRPRTF command. The problem is that when printing the system handles everything through the FRONTOVL, so even if the file in the spool shows that the correct BACKOVL overlay is being used, it doesn't get printed.

    So far the only "solution" we have been able to find is to use two printer files in the same program and use the first file for the first page and so on.

    Is there a better way to do this? We don't have duplex capable printers, so that isn't an option. When does the BACKOVL get used?

  • #2
    Re: Printing two overlays on the same printer

    A couple of quick questions:

    1. Are you duplex printing?
    2. Have you tried to swap the front and back page overlays to ensure that there is no issue with the back page overlay?
    Michael Catalani
    IS Director, eCommerce & Web Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

    Comment


    • #3
      Re: Printing two overlays on the same printer

      1. as i said, we are not duplex printing.
      2. i can see both overlays fine when using two printer files in the same program. the issue is that i get two spool files and what i would like to do is to see only one with both pages in it.

      we are trying to create a new prtf with two records with the OVERLAY command in them to see if this would work. i have tried this in the past and had issues with it but i am trying again.

      Comment


      • #4
        Re: Printing two overlays on the same printer

        You can imbed the code directly into your printer file and this will do what you are looking to do. We use to print a two-sided invoice - invoice overlay and the invoice on the front, and terms and conditions on the back, but we were able to get away from that.


        Define the following in your printer file:
        A*
        A* Images/Page Segments
        A* - variable overlay name from program
        A*
        A R PRTOVL
        A OVERLAY(&OVRLAY 0 0)
        A OVRLAY 8A P
        A*
        A* Forces page advance
        A*
        A R ENDPAG
        A ENDPAGE

        Then in your program code this (keep in mind this is out of an RPGIII program):
        *
        C MOVE 'TERMS ' OVRLAY
        C BJCOCD IFEQ '04'
        C WRITE ENDPAG
        C WRITE PRTOVL
        C ENDIF

        You have to have the ENDPAG otherwise the printer doesn't know to go to a new page. I have some additional information from IBM on this when I can find I will post for all. We don't use pre-printed forms - everything we need a form for we create the overlay for (easy peazy) and create a printer file, and print it ourselves. Saves us loads of money...

        Comment


        • #5
          Re: Printing two overlays on the same printer

          Originally posted by fjleon View Post
          1. as i said, we are not duplex printing.
          You mentioned that you didnt have duplex printers. What I was referring to is whether you were specifying the DUPLEX keyword on the OVRPRTF. In fact, if you could post the exact OVRPRTF command, that would help.
          Michael Catalani
          IS Director, eCommerce & Web Development
          Acceptance Insurance Corporation
          www.AcceptanceInsurance.com
          www.ProvatoSys.com

          Comment


          • #6
            Re: Printing two overlays on the same printer

            Code:
            OVRPRTF    FILE(IP0788) DEVTYPE(*AFPDS) PAGESIZE(88 + 
                         125) LPI(8) CPI(15) OVRFLW(88) +         
                         PRTQLTY(*DRAFT) FRONTOVL(QGPL/CUPOREF1) +
                         COPIES(1) LVLCHK(*NO)                    
            OVRPRTF    FILE(IP07FJ) TOFILE(QGPL/IP0788) +         
                         DEVTYPE(*AFPDS) PAGESIZE(88 125) LPI(8) +
                         CPI(15) OVRFLW(88) PRTQLTY(*DRAFT) +     
                         FRONTOVL(QGPL/CUPOREF2) +                
                         COPIES(1) LVLCHK(*NO)                    
            CALL       PGM(*LIBL/PIEDRA6)
            we are going to be testing the solution provided by NYCountryGal which seems fine

            Comment


            • #7
              Re: Printing two overlays on the same printer

              Embedding the overlay gives you the most flexibility.


              Otherwise, if you simply wanted to use the OVRPRTF, you would have to specify duplex *yes, even if you didnt have a duplex printer. Duplex *YES is what tells the printer file that every other page is a back page, and to apply the back page overlay to that page. Without Duplex *YES, every page is treated as a front page.
              Michael Catalani
              IS Director, eCommerce & Web Development
              Acceptance Insurance Corporation
              www.AcceptanceInsurance.com
              www.ProvatoSys.com

              Comment


              • #8
                Re: Printing two overlays on the same printer

                forgot to post, the solution provided by NYCountryGal worked just fine, thanks!

                Comment


                • #9
                  I need some help regarding this.I have a multi-page report which when I do what NYCountryGal recommended. But the overlay only works on the first page and last page. the pages in between does not show the overlay in the PDF.

                  Does anyone have any thoughts on this?


                  This is what I did in my code (program was written in RPG3)

                  C* write the header
                  C MOVEL'QGPL' LIB
                  C MOVEL'POROB20' OVLS
                  C Z-ADD.16 FRMD
                  C Z-ADD0 FRMA
                  C WRITEPRTFORM
                  C WRITEHEADR

                  ...
                  C* write the footer and terms&condition when last record
                  C WRITEFOOTRP1
                  C WRITEENDPAGE
                  C WRITEPRTTERM



                  This is a snippet of my RLU


                  A*%%********************************************** *************************
                  A*%%SS
                  A*%%********************************************** *************************
                  A R HEADR
                  A*%%********************************************** *************************
                  A*%%RI 00000
                  A*%%********************************************** *************************
                  ..... some data in this record header
                  A R DETL
                  A*%%********************************************** *************************
                  A*%%RI 00000
                  A*%%********************************************** *************************
                  ..... some data in this record detail
                  A R ENDPAGE
                  A*%%********************************************** *************************
                  A*%%RI 00000
                  A*%%********************************************** *************************
                  A ENDPAGE
                  A R PRTTERM
                  A*%%********************************************** *************************
                  A*%%RI 00000
                  A*%%********************************************** *************************
                  A OVERLAY(QGPL/PORTERM 0 0)
                  A R PRTFORM OVERLAY(&LIB/&OVLS &FRMD &FRMA)
                  A LIB 10A P
                  A OVLS 8A P
                  A FRMD 5S 3P
                  A FRMA 5S 3P
                  idiot and stoopid with SQL

                  Comment

                  Working...
                  X