Oracle Reports Barcode Fonts TutorialThis tutorial illustrates how to create barcodes in Oracle Reports Developer using the PL/SQL scripts from the ConnectCode Barcode Fonts package. All the PL/SQL barcode scripts are located in the "Resource\Oracle PLSQL Barcode" subdirectory of ConnectCode Barcode Fonts.
Type of Barcodes Supported
- Code39 - Code39.sql
- Code39 ASCII - Code39ASCII.sql
- Code128A - Code128A.sql
- Code128B - Code128B.sql
- Code128C - Code128C.sql
- Code128Auto - Code128AUTO.sql
- EAN8 - EAN8.sql
- EAN13 - EAN13.sql
- EXT2 - EXT2.sql
- EXT5 - EXT5.sql
- GS1Databar 14 - GS1DATABAR14.sql
- I2of5 - I2OF5.sql
- POSTNET - POSTNET.sql
- UCCEAN - UCCEAN.sql
- UPCA - UPCA.sql
- UPCE - UPCE.sql
AssumptionsThis tutorial assumes that you have Oracle Developer Suite installed and have access to the Oracle Database using the default "scott" user.
Step-by-Step instructions1. The first step involves running the PL/SQL scripts that come with ConnectCode Barcode Fonts to create the Stored Procedures/Functions that will help you generate the barcodes. Goto Start Menu -> Oracle - OraDb10g_home1 -> Application Development -> SQL Plus.
2. Login as user "scott" with password "tiger" to the orcl database.
3. In SQL Plus, execute the PL/SQL scripts from ConnectCode Barcode Fonts using the following command @"C:\Program Files\ConnectCode\Resource\Oracle PLSQL Barcode\Code39.sql" or if are using the Trial @"C:\Program Files\ConnectCodeTrial\Resource\Oracle PLSQL Barcode\Code39.sql" You should see the message "Package created.", "Package body created" and "PL/SQL procedure successfully completed.". If you like to create other type of barcodes, execute the appropriate PL/SQL script from the directory. See the complete list of barcodes supported in PL/SQL.
4. You can now test the PL/SQL function by running the following SQL statement in SQL Plus. "SELECT CONNECTCODE_CODE39.ENCODE(EMPNO,1) FROM EMP;"
The ENCODE function will verify the EMPNO input data, translate the data input to ConnectCode barcode fonts characters, add any barcode start/stop characters and optionally generate the check digit. The output of the ENCODE function is in text and can be transformed to an industry compliant barcode by selecting the CCode39_S3 or CCode39_S3_Trial barcode font in your reports.
5. Next you can launch Oracle Reports Developer by going to the Start Menu -> Oracle Developer Suite -> Reports Developer -> Reports Builder. We will be creating a report that generates the EMPNO (Employee Number) field as a barcode. The report will be using the PL/SQL function that we created earlier.
6. Upon launching Reports Builder, choose to "Use the Report Wizard".
7. Click on the Next button in the "Welcome to the Report Wizard!" screen.
8. Select to "Create both Web and Paper Layout" and click on the Next button.
9. Key in "Code39 Barcodes" as the Title and leave everything as default and click Next. 10. In "Choose a data source type below" screen, select "SQL Query" and click Next.
11. In the "Data Source definition" screen, click on the "Connect" button and connect to the database as the "scott" user ("tiger" as password) to your orcl database.
12. Key in the following SQL in Data Source definition field. "SELECT CONNECTCODE_CODE39.ENCODE(EMPNO,1) FROM EMP;" This statement will call the ConnectCode PL/SQL Code39 function to convert the EMPNO input data to barcode font characters.
13. In the "Select the fields that you would like to display in your report. You may add other fields later." screen, select the fields as below:
14. In the "Select the fields for which you would like to calculate totals." screen, leave everything as default and click Next.
15. In "Modify the labels and widths (number of characters) for your fields and totals as desired", leave everything as default and click Next.
16. In "Choose a template for your report. Your report will inherit the template's colors, fonts, line widths, and structure" screen, click Next and Finish.
17. Finally set the font of the EMPNO output to CCode39_S3 (or CCode39_S3_Trial) and Font Size to 24 as shown below. Your Oracle Report with an industry compliant Code 39 barcode is now ready.