The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Monday, 29 July 2013

Printing Bar Codes with SQR

Sometimes the life of a clerk is made easy by making a barcode available into your reports. For instance you can think of invoices sent to customers or expense report receipts collected from your employees having barcode enabled. This allows you to easily attach a physical document with an electronic document residing inside your system.

You can have this feature in PeopleSoft with the help of SQR programs. Typical implementation of a barcode to one of your reports is an easy task provided you already know the barcode standard that need to be used. The function print-bar-code in SQR prints a barcode of your specified type and data.  SQR supports 15 different types of barcodes. The supported types are

Text Length
11, 13, or 16
11, 13, or 16
12, 14, or 17
7, 9, or 12
3 of 9 (Code 39)
1 to 30
Extended 3 of 9
1 to 30
Interleaved 2 of 5
2 to 30
Code 128
1 to 30
1 to 30
Zip+4 Postnet
5, 9, or 11
MSI Plessey
1 to 30
Code 93
1 to 30
Extended 93
1 to 30
1 to 30

The barcode generation syntax is made as simple as possible.  You can take a look at the syntax provided below. For more details on barcode generation and other SQR functions, you may refer the PeopleBooks on that topic.


The TYPE will take a value listed in the table above which will create an appropriate barcode. The HEIGHT parameter will set the height of the barcode printed. If you are trying to print a barcode for an expense report in the system, then the unique id or the expense report id should be set to the property TEXT. CAPTION is an optional property, if you want the expense report id to be printed along with the barcode, then you may use this property. I advice to use this always to be in a safer position, if by mistake your barcode reader fails or if the image is faded, then you can easily identify the transaction in database with the caption text. CHECKSUM property takes a Yes or No value to compute and print the checksum.

I have mentioned about the usage in an expense report, let us see how the code will look like for this use case.

   print 'Nicoles Expense Report’ (1,1)
   print-bar-code (3,1)
      type=1                                              ! Type = UPC-A
      height=0.3                                      ! Sets the height
      text=’ER345’                                  ! Unique id to distinguish the expense report
      caption=’ER345 Nicole USA’       ! Meaningful information to identify the database transaction manually



  1. Hi,

    Thanks for providing detailed explanation on how to print barcodes through SQR.

    We are on PeopleTools 8.52 and PS 9.1 application version. We have a requirement where we need to display the "Item UPN value" in a barcode format on the peoplesoft web page.

    User will click on 'generate my barcode' from PeopleSoft online page for item value, then barcode should be generated based on UPN value. User will then take the print of that barcode and use for some labelling purpose.

    Can you please provide the necessary steps on how we can achieve this?


    1. Hi Narry,

      If the intention of your business application is to generate a bar code that can be printed for labeling purpose, then you can extend the concepts described for SQR. First you need to create a SQR which prints barcode (check the post to see how) for the UPN value entered (UPN Value should be one of your run control parameter).
      Now the trick is you need to have REN server configured. If it is already configured then you are safe to proceed to next step. On the online page whenever user enters the UPN value and hits the “Generate” button, run the SQR report with ‘Run to Window’ option. The report output will be automatically opened in a new window (with the REN server configuration), which the user can directly take a print out.

      -PeopleSoft Journal

  2. Banners of all kinds are used today for advertising goods and services, and a lot of organizations and individuals have used banners for this purpose. More modern and unique types of banners make the advertising world more colorful and attractive. The use of roller banners today has become very popular chiefly because it has many benefits when compared to other forms of advertising. Roll up Stands