Home > AS/400 Tips > iSeries programmer tips > Printing techniques: Enhance reports with highlighted or underlined text
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Printing techniques: Enhance reports with highlighted or underlined text


Dwight Beech, Search400.com expert
11.20.2002
Rating: -3.08- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


You Can View User Feedback To This Tip


Dwight Beech

Have you ever wanted to highlight or underline a field in a report? This can be done two ways: by using a print file (PRTF) or embedding the code within the print specifications of an RPG program. The PRTF can be edited using SEU or RLU (Report Layout Utility).

If using a PRTF, then using the HIGHLIGHT keyword takes care of it easily. This keyword can be used at the record and field levels. When inserted into the PRTF, HIGHLIGHT automatically performs an overstrike so the field is highlighted or made bold.

The UNDERLINE is used only at the field level, and it specifies that the field to be printed will also contain an underline.

Here is the sample code for HIGHLIGHT and UNDERLINE.

*&-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 
 *&    HIGHLIGHT AND UNDERLINE EXAMPLES                             * 
 *&                                                                 * 
 *&     CREATION    - 11/18/2002   DWIGHT BEECH                     * 
 *&                                                                 * 
 *&-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 
A          R PAXRNX                                                   
A                                    11'EMPLOYEE NAME:'               
A                                      HIGHLIGHT                      
 *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*  
A          R TOTLM                                                    
A                                    46'NAME'                         
A                                      UNDERLINE                      
A                                    68'ADDRESS'                      
A                                      UNDERLINE                      

Another method is to insert printer controls within the print specifications of your RPG program. This can be accomplished by inserting a zero in the SPACE AFTER field in the first occurrence of the print record PRTHDR and then subsequently inserting a one in the SPACE AFTER field in the second occurrence of PRTHDR.

At print time the program executes the WRITE statement of the first occurrence of PRTHDR and will not skip a line space. So when PRTHDR is executed again, it will then overstrike the same area specified. (See example below.) You can execute an underline sequence the exact same way as shown in the underline example.

Highlight example:

   O        E  0             PRTHDR                    
   O                                  108 'Time:'      
   O        E  1             PRTHDR                    
O        108 'Time:'      

Underline example:

   O        E  0             PRTHDX                    
   O                                  108 'Time:'      
   O        E  1             PRTHDX                    
O                                  108 '____'      

The ability to provide highlighting and underlining can enhance your report presentation immensely. The only caution is that highlighting and underlining may not work properly on all printers, especially some of the older models.

-----------------------------------
About the author: Dwight Beech is superintendent, application support, at Cameco Corp. in Saskatoon, Saskatchewan, Canada, where he manages the operation of the application support group supporting 35 business applications.

USER FEEDBACK TO THIS TIP

  • If you code your "O" spec this way you will be unable to to see the column heading if you look at the report using the WRKSPLF command You need to print the underline first the column heading.

    Underline example:

     
       O        E  0             PRTHDX
       O                                  108 'Time:'
       O        E  1             PRTHDX
       O                                  108 '____' 
    — Bryan Dietz

==================================
MORE INFORMATION
==================================

  • Modifying the WSCST to adjust the first print line
    Site expert Tim Granatir advises how to modify the WSCST to move the first print line down the page on certain IP printers.
  • Change report info without running the program again
    Has there ever been a time when you wished you could change information on a report without having to run the program again? Well, wish no more. By following these seven steps, you can have that report changed in minutes.
  • Using SDA to create printer files
    Did you know you can use Screen Design Aid (SDA) to create printer files? All of us use SDA everyday to create screens, but the only tools we have for printer files are SEU, RLU and Code Designer. Site expert John Kohan said he's seen people code extraordinary printer files in SEU, but the mass of RPG programmers just do not do enough printer files to hone skills to that level. Follow these steps to learn how to use SDA instead.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries ILE programming
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
How to use an embedded SQL statement and display the result in a subfile
Eight steps for creating program documentation using AS/400 utilities
Searching fields for values
Searching part of a name or address in AS/400
Top 10 programmer tips YTD
How to use the binder language to manage service programs -- Part 3: Examples and pitfalls
Top 10 programmer tips of 2005
Understanding the binder language on AS/400

iSeries CL programming
Taking advantage of CL advancements, starting with V5R3
Checking in on your IBM i authorization lists
Running PHP open source applications: NOBODY needs authority
Simplify the process of converting a spool file from iSeries into an Excel spreadsheet
CL program for daily backups
An automated CL method of moving a query from AS/400 to Excel
Changing user password expiration
Eight steps for creating program documentation using AS/400 utilities
DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
Advanced Job Scheduler help

iSeries programmer tips
Enhancing RPG with external SQL stored procedures
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
Implementing a browser interface in COBOL: Displaying database fields
Taking advantage of CL advancements, starting with V5R3
TAATOOL: Useful tools for programmers on IBM i
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
Making the most of RPG data handling on IBM i
Groovy programming on IBM i

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts