ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Assigning Printer to a report

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

  • Assigning Printer to a report

    I'm generating the reports using RPGLE and RLU, all the report came fine, but the problem is assigning the specific printer where the report should get printer once after Report gets generated.. i want to know the logic or commands to define a specific printer where I want to get my report generated. In AS/400 only using COBOL my colleagues are able to print the report on which ever the printer they want by mentioning the same in program.

    Please guide me in this, as because of this reason they wanted me not to code in RPG and instead they want to write the programs in COBOL.

    Thanks,
    Anil

  • #2
    Re: Assigning Printer to a report

    Originally posted by medam.anil View Post
    In AS/400 only using COBOL my colleagues are able to print the report on which ever the printer they want
    They won't help you? It seems that if they can do it, you should be asking them to show you how.
    "Time passes, but sometimes it beats the <crap> out of you as it goes."

    Comment


    • #3
      Re: Assigning Printer to a report

      No, they are also just using the function QCmdExc and printing, no one is using RPG here, only 'm using RPG, but I don't know how to print, y'day mike mailed me with this QCmdExc Function, but still 'm not able to print the generated report, it's giving the Run time Error when it is calling QCmdExc function at that point it's giving
      Statement/Instruction . . . . . . . . . : /0206
      Program . . . . . . . . . . . . . . . . : QCMDEXC
      Recursion level . . . . . . . . . . . . : 1

      Errors occurred in command.


      I feel I defined variables wrongly.
      Find the declaration below how I did.
      PRT055PR is my printer File and DSPRT04 is my printer name below:

      Code:
      FPRT055PR  O    E             PRINTER OFLIND(*IN60) usropn
       
      DCmdstring        S            255                     
      DCmdlength        s             15S 5                  
       
       
      C                   EVAL      cmdstring ='OVRPRTF FILE(PRT055PR) DEVTYPE('+
      C                             '*AFPDS) CPI(12) PAGRTT(90) OUTQ(DSPRT04)'
      C                                 +  ' OVRFLW(45)'                     
       
      C                   eval      cmdlength = &#37;len(%trim(cmdstring))   
      C                   call(e)   'QCMDEXC'                            
      C                   parm                    cmdstring              
      C                   parm                    cmdlength              
      C*                                                                 
       
      C                   if        not%open(PRT055PR)       
      C                   open      PRT055PR                 
      C                   ENDIF                              
      C
      If you have any idea can you help me out.

      Anil.

      Comment


      • #4
        Re: Assigning Printer to a report

        This was already answered...please read your other posts...

        The cmdlength variable must be packed remove the S from the D-spec


        jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: Assigning Printer to a report

          it's great, I got it printed in my desired printer. Thanks for your great help.

          Comment

          Working...
          X