Table or Box in Printer File in AS/400

2475 pts.
Tags:
AS/400
Printer files
Hi! I just want to add two small boxes like table in the Printer File in AS/400. I'm not aware that how can i do that ? For the top margin I've used _ Symbol and for the side margin I've tried | Symbol. but it doesn't look like a table or box in the output. Can you please suggest me? Surey.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 28  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Have you tried the BOX keyword in your printer file DDS? -- tOM
    125,585 pointsBadges:
    report
  • philpl1jb

    box here: http://publib.boulder.ibm.com/html/as400/v4r5/ic2979/info/db2/rbafpmst580.htm#HDRPTBOX

    I believe that it requires that you compile the printer file as AFPDS.

    Device type of the printer must be AFPDS.

     

     

    51,365 pointsBadges:
    report
  • Sureyz
    No..  I haven't tried it. can you give me some sample code..


    Surey
    2,475 pointsBadges:
    report
  • TomLiotta

    Sample code? Sure. Hare are a couple examples:

         A          R BOX1                      BOX(1.2 0.5 5.1 6.3 0.2)
         A*
         A          R BOX2                      BOX(2 5 5.0 3.33 *WIDE)
         A                                      BOX(0.5 0.1 2.1 2.0 0.09)
    

    You could have seen those by going to the link I supplied, so I can't tell what good it is to copy them here. The link to the keyword documentation is far better with more information. You probably could have seen the samples much sooner.

    Tom

    125,585 pointsBadges:
    report
  • Sureyz
    Thanks for the Tom,
    Actually I have added these codes in the PRTF and compiled using DEVICE TYPE as AFPDS. but when i try to see the design using option 19 (STRRLU) in giving a line as AFPDS Record format. Then the box is not appearing in the spool file when i print it.

    Can you please explain??


    Surey
    2,475 pointsBadges:
    report
  • TomLiotta

    Can you please explain?

    Maybe. But all relevant coding will need to be shown first. That includes the related DDS and any program statements that reference the printed page. Other questions might follow.

    Tom

    125,585 pointsBadges:
    report
  • Sureyz
    A          R RCD008                                               
    A*%%**************************************************************
    A*%%RI 00000                                                      
    A*%%**************************************************************
    A                                      SPACEB(001)                
    A                                      SPACEA(003)                
    A            FI             6A        6                           
    A                                      BARCODE(CODE128 4)         
    A                                      SPACEB(001)                
    A                                    29                           
    A                                      'SURESHKUMAR'              
    A*%%**************************************************************
    A*%%SS                                                           
    A*%%CL 001                                                       
    A*%%CL 003                                                       
    A*%%**************************************************************
    A          R BOX1                                                
    A*%%**************************************************************
    A*%%RI 00000                                                     
    A*%%**************************************************************
    A                                                                
    A          R BOX2                      BOX(2 3 5 6 0.2)          
    A*%%**************************************************************
    A*%%RI 00000                                                     
    A*%%**************************************************************
    A                                      BOX(2.5 1.5 5.1 6.3 4.2)  
    A                                      BOX(2.5 1.5 5.1 6.3 4.2)  
    A          R RCD010                                              
    A*%%**************************************************************
    A*%%RI 00000                                                     
    A*%%**************************************************************
    A                                      SPACEB(001)               
    A            BX001          5A  O    12                          
    A                                      SPACEB(001)               
    A*%%**************************************************************
    A*%%SS                                                           
    A*%%CL 001                                                       
    A*%%CL 002                                                       
    A*%%CP+999CRTPRTF                                                
    A*%%CP+    FILE(SURESH/SAMLEU)                                   


    This is my code. the box will appear in the spool file ???



    2,475 pointsBadges:
    report
  • TomLiotta

    This is my code. the box will appear in the spool file ?

    It's hard to say. There is no program code that shows how the records are written. I can't tell if a BOX record is ever written, nor what else might be written with the box. Also, it's not clear if you want the box to be on a blank part of a page or you want some of your data fields to be inside the box.

    Are you using some viewer to look at the spooled file? Or have you looked at actual printed output on paper?

    Finally, be very aware of this from the documentation link:

    • When the BOX keyword is specified on a record format, all fields within the record format must be positioned using the POSITION keyword.

    And if you think about what the printer does after it prints a box and think about the POSITION keyword, this part of the documentation should make more sense:

    • You cannot specify BOX with the SPACEA, SPACEB, SKIPA, or SKIPB keywords.

    Tom

    125,585 pointsBadges:
    report
  • Sureyz
    Tom.. im just trying to do this with a small program.

    A*%%**************************************************************
    A*%%TS  RD  20131220  151859  SURESH      REL-V6R1M0  5761-WDS   
    A*%%FI+10660100000000000000000000000000000000000000000000000000  
    A*%%FI       0000000000000000000000000000000000000000000000000   
    A*%%**************************************************************
    A*%%**************************************************************
    A*%%RI 00000                                                     
    A*%%**************************************************************
    A          R BOX1                      BOX(1.2 0.5 5.1 6.3 0.2)  
    A            NAME           6A  O      POSITION(2.0 1.9)         
    A*%%**************************************************************
    A*%%SS                                                           
    A*%%CL 011                                                       
    A*%%CP+999CRTPRTF                                                
    A*%%CP+    FILE(SURESH/SAMLEU)                                   
    A*%%CP+    DEVTYPE(*AFPDS)                                       
    A*%%CP     PAGESIZE(*N       080      *N     )                   
    A*%%**************************************************************

    and the program is .

    FSAMLEU    O    E             PRINTER                                 
    c                   Move      'Sureyz'      NAME                      
    c                   Write     BOX1                                    
    c                   SetOn                                            LR

    But when i try to open the spool file I'm getting,.

    " File SAMLEU number 14 cannot be displayed, copied, or sent."

    How to view this spool file and I'm using PDF Creator to take PDF print out.
    How can i configure for that..

    Sureyz.

    2,475 pointsBadges:
    report
  • TomLiotta

    But when i try to open the spool file I'm getting,.

    " File SAMLEU number 14 cannot be displayed, copied, or sent."

    How are you to "open" the spooled file? What message is that? Without a message identifier, I can't tell what that means. (I can guess it's CPF3429, but I could be wrong. And if it is CPF3429, there is much more to the message that tells why the message was sent. Did you follow the directions in the message?)

    How to view this spool file and I'm using PDF Creator to take PDF print out.
    How can i configure for that

    I'd probably use iSeries Navigator to view the spooled file. When I create your printer file program on my system and run it, it works fine.

    As for "PDF Creator", what is that? Is it an iSeries program? Who is the vendor? What do the instructions for "PDF Creator" tell you about how to configure for it? I don't have that product, so I can't guess how to configure it.

    I just use the normal i 6.1 facilities for creating .PDFs into a directory in the /root file system. Your example creates fine for me. I then use a free .PDF viewer on my PC to look at them.

    Tom


    125,585 pointsBadges:
    report
  • Sureyz
    Finally i got the output.
    Thanks for the message about the system navigator Tom

    Surey

    2,475 pointsBadges:
    report
  • TomLiotta
    The iNav AFPDS viewer has been included for many years. It's not particularly good, and you need to be sure you stay current on the iSeries Access service packs. Still, it can be handy for getting things like this started. -- Tom
    125,585 pointsBadges:
    report
  • Sureyz
    Sure Tom..

    I got an another question here.
    I defined two record format in the same PRTF as RCD01 and BOX01.
    and Box position starting from 8th line of the page. and i defined the RCD01 before that to display some constants.

    As per the Box keyword, whatever field mentioned in the BOX01 record format, needed to be specify with POSITION keyword. It means the filed will be appear inside the box. can be outside also ?

    But in RCD01 record format itself i can able to mention the position of a particular field which will be appear inside the box without mentioning the POSITION keyword. Simply i can define all the fields and constants in the RCD01 then finally can write BOX01 record format which will not require any fields to be define in BOX01 record format..

    So is ok? but im getting the output perfectly.


    Surey.

    2,475 pointsBadges:
    report
  • TomLiotta

    A BOX has to be drawn on a page, so it needs to be placed by POSITION. After the box is drawn, the page has moved up, so anything else on the page would always print below the box.

    In order for text to show on the same page as a box, the page has to be moved back down in the printer. That is done by specifying POSITION for the text fields. Everything on a graphics page has to be "positioned". You can change positions up and down, and back up again. As long as you use POSITION, you can put things anywhere on the page.

    Things can be inside or outside the box, above the box or below it.

    Tom

    125,585 pointsBadges:
    report
  • Sureyz
    But im got the output without mentioning any position keyword in either RCD01 or BOX01. But the problem what i faced the font style and character space is not come out as i mentioned in the program.

    What is the FOND ID in CPI ? is there any link between CPI and FONT keyword ?


    Surey.

    2,475 pointsBadges:
    report
  • TomLiotta
    You have two different record formats. Multiple record formats can be put onto a single page as long as they don't skip to a new page. There are potential restrictions if output from one format conflicts with other formats.

    However, it is not clear what you are asking. You aren't showing any source, so I'm not sure what the situation is. Is it working the way you want? Is something going wrong?

    Tom

    125,585 pointsBadges:
    report
  • Sureyz
    R   RCD01
                                     59  8                          
                                          'Date of Issue:'          
                                          FONT(4919 (*POINTSIZE 11))
                                     60  8                          
                                          'Time:'                   
                                          FONT(16951 (*POINTSIZE 10))
                                     63  8                          
                                          'Examined'                
                                          FONT(4919 (*POINTSIZE 11))
                                     63 58                          
                                          'Registered User'      
                                          FONT(4919 (*POINTSIZE 12))
              R BOX001                                              
                                          BOX(0.5 0.5 1.3 7.5 0.004)
              R BOX002                                             
                                          BOX(1.8 0.5 8.0 7.5 0.004)
              R BOX003                                             
                                          BOX(8.2 0.5 8.8 7.5 0.004)



    This is my code and i have some fields in the starting of the page. Getting the output with three boxes which is perfect. The page size is not exceeded to one page. While compiling im using LPI as 66 and CPI as 90. But the output always giving me the default font i Guess. Because there is no change in the size and the style.

    There is something called FONT ID in the place of CPI.
    Is it representing any font style and what is use of FONTNAME keyword ? 


    Surey.

    2,475 pointsBadges:
    report
  • Sureyz
    Any answer for the previous question ?
     
    Still however i got some solution. When i view the spool file using the iSeries Navigator Viewer it's showing the output exactly with the font and size which i mentioned in the program. But when i print this in HP LaserJet 1010 Series(tried on other printers also) its giving me the output with the different font and size. for each printer it is different output.

    Surey
    2,475 pointsBadges:
    report
  • TomLiotta

    The page size is not exceeded to one page. While compiling im using LPI as 66 and CPI as 90.

    First, the LPI and CPI values don't make sense. LPI can't be (66) and CPI can't be (90). If LPI was (66), it would mean printing 66 print-lines per inch. Each line of print would only 1/66th of an inch tall. And if CPI was (90), it would mean printing 90 characters per inch. Characters would be approximately 1/90th of an inch wide. I don't think you can compile with LPI(66) nor CPI(90).

    Then, if you have a page length of (66) lines, the overflow line will default to (60). You have text printing on line (63) which would exceed the standard printing line on a page.

    Tom

    125,585 pointsBadges:
    report
  • Sureyz
    Hi Tom,

    I made a mistake before. Actually the LPI is 6 and CPI is 12. When i view the spool file using the iSeries Navigator Viewer it's showing the output exactly with the font and size which i mentioned in the program. But when i print this in HP LaserJet 1010 Series(tried on other printers also) its giving me the output with the different font and size. for each printer it is different output.

    Should i mention any parameter while compiling the Printer File.. ?

    Surey

    2,475 pointsBadges:
    report
  • philpl1jb

    When you request FONT(4919 (*POINTSIZE 11))

    it will use a built in font of the printer..

    51,365 pointsBadges:
    report
  • TomLiotta

    ...it will use a built in font of the printer..

    That assumes that FONT 4919 (Goudy old style) is not available or cannot be downloaded to the printer (and perhaps other considerations). It would seem to be true for the HP LaserJet 1010 in this question. A font substitution would be done if the specified font cannot be used on the printer.

    Tom

    125,585 pointsBadges:
    report
  • Sureyz
    Even I have tried with FONT 2308, 2309, 2310 ( Times New Roman Regular,Bold,Italic).
    But still I'm getting the same result as printer default font. Also from the IBM Font list many categories of same font type. Should mention some more keywords with FONT in Printer File.

    Surey.
    2,475 pointsBadges:
    report
  • TomLiotta
    If I use FONT(2310...) and I also correct the line numbers for the constants, the output is correct for me when I view the spooled file with iSeries Navigator. I don't have any way to test a HP LaserJet, so I can't say anything about it. Do you see the expected fonts when you use the iNav viewer? If you do, then there isn't anything else that can be done except not to use the HP LaserJet for output. This, of course, assumes that you are compiling the PRTF for a *AFPDS printer. -- Tom
    125,585 pointsBadges:
    report
  • Sureyz
    I'm getting the exact output as how i mentioned in the program when view with iNav Viewer. The Problem with the printer session i guess. Because i have tried to print in other printers also. Do you think some there would problem in the option "transform print data to ASCII on System i" . And what is Font for system i print file ? Im using IBM i Access for windows software.

    Surey.
    2,475 pointsBadges:
    report
  • TomLiotta

    And what is Font for system i print file ?

    Since you have a font specified for each print field, it shouldn't matter what font is specified for the printer file. I left it as the default.

    Im using IBM i Access for windows software.

    You're using it to do what? The only thing it should be doing is displaying the spooled file in i Nav. Otherwise it shouldn't be involved at all. Or are you saying that you are using an iSeries Access printer session?

    Tom


    125,585 pointsBadges:
    report
  • Sureyz
    im using iseries access printer session. but i used the same printer model(HPT) as mentioned in the IBM provided list.let me try with another printer model.


    Surey
    2,475 pointsBadges:
    report
  • TomLiotta
    I have no way to know if the session you defined can handle your spooled output. For any specific iSeries Access printer session, you'll have to ask IBM Support. That's way beyond basic AFPDS printer output. -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following