Overview

This document talks about how to display report column values as bar codes in Oracle Apex. this has been achieved using JavaScript.

Technologies and Tools Used

The following technologies have been used to achieve the expected output.

  • JavaScript
  • Oracle Apex

Use Case

Assume that we are having the interactive report in the oracle apex application. We want to display the column value in the report as the bar code.

This document explains how to achieve this requirement.

Architecture

The following steps explain in detail,

Step 1: 

We need to upload the “JsBarcode.all.min.js” JavaScript file in the static workspace file or static application file.

You can download the JavaScript using the below link,

https://lindell.me/JsBarcode/

Step 2:

Select the static workspace files or static application files in shared components. Then, click the create file option and upload the downloaded JavaScript.

From the Static workspace, In the “files report” copy the texts from the reference column.

Step 3:

Paste the copied text in the JavaScript file URLs section.

Step 4:

Create the dynamic action after the refresh event to Initialize the value in the bar code generator JavaScript code.

Select the true action on execute JavaScript Code and enter the below JavaScript Code.

JsBarcode(“.barcode”).init();

Step 5:

Create the report in the interactive report type.

Then, add the below code in the SQL query of the interactive report.

‘<svg class=”barcode”

  jsbarcode-format=”CODE128″

  jsbarcode-value=’||empno ||’

  jsbarcode-textmargin=”0″

  jsbarcode-fontoptions=”bold”>

</svg>’ as barcode

In the jsbarcode-value, We can add the column name which we want to convert into bar code. Here we have used “empno”.

Conclusion

Output:

Using the above steps we can change the interactive report column values as bar code.

Recommended Posts

Start typing and press Enter to search