Ticker

6/recent/ticker-posts

How to Generate QR Code in Oracle APEX - Javainhand Tutorial

How to Generate QR Code in Oracle Apex

Hello Friends, Welcome to Javainhand.com In this post, we are going to tell you about the QR code generator in oracle apex. In Recent times QR Code is a very demanding and useful implementation in any website or as we have seen in the mobile applications. you can store any information in QR Code. So I am trying to explain to you how can you QR code generator in oracle apex.

So Let's Start Our Topic

What is QR Code?
How to Generate QR Code in Oracle APEX?

What is QR Code?
QR Code is a two-dimensional barcode that is used to store encoded data. People also share their websites link or other information using QR Code.

In this implementation, I am using a third party library QRCode.js. QRCode.js is a javascript library that helps you to generate QR Code.

How to Generate QR Code in Oracle APEX?

Let's Start to follow the below steps to implement QR code generator in oracle apex

Step 1:-Create a Region QR Code Generate, In the Region creates an Input Item and Button. Below Screenshot will help you out.

How to Generate QR Code in Oracle Apex










Step 2:- Create a Display QR Code Region and paste the below code into region static content. the below screenshot will help you.

How to Generate QR Code in Oracle Apex









<div id="qrcode" ></div>

Step 3:- Copy the below URL in to Page Javascript File URLs Section.

https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js

Step 4:- Copy Below Code into Function and Global Variable Declaration Section.

var qrcode = new QRCode(document.getElementById("qrcode"), {
width : 256,
height : 256
});

function makeCode () {
var elText = document.getElementById("P17_INPUT");// Inseed of P17_INPUT use your item name
if (!elText.value) {
elText.focus();
return;
}
qrcode.makeCode(elText.value);
}

Step 5:- Now Call makeCode() function to Generate Button click dynamic action. The below screenshot will help you.

How to Generate QR Code in Oracle Apex










Identification:- Execute Generate QR Code Function
Event:-Click
Selection Type:- Button
Button:- Generate

How to Generate QR Code in Oracle Apex








True Action:- Execute Javascript Code
Code:- makeCode();

For Demo:- Click Here

If You Like This Tutorial Please Like Share And Comment.

Post a Comment

16 Comments

  1. How am I able to download the QR code using a button?

    ReplyDelete
    Replies
    1. If You want download QR Code in your system then create a Download QR Code Function. Use below code into function and Global Declaration Section

      function download_qrcode(){
      html2canvas(document.querySelector("#qrcode")).then(function(canvas) {
      var a = document.createElement('a');
      a.href = canvas.toDataURL("image/jpeg").replace("image/jpeg", "image/octet-stream");
      a.download = 'image.jpg';
      a.click();
      });
      }

      After that code this function into your button click dynamic action.

      One more thing add below URL into your Javascript URL Section.
      https://html2canvas.hertzen.com/dist/html2canvas.js

      I think this code will help you.


      Delete
  2. Hello, I hope you're doing well.

    This code is great, congratulations, I would like to store the QR image to a blob column, is that possible?

    Could you help me, please.

    ReplyDelete
    Replies
    1. Yes It is possible to store the QR image to a blob column with the help of ajax process.

      Delete
  3. how to genrate 2d data matrix please

    ReplyDelete
  4. Hello Is it Possible to generate qr code by passing multiple values.

    ReplyDelete
    Replies
    1. Yes, you can pass multiple values. Go to the javascript code, where we fetch value from our page item there you can add one more variable and pass value.

      Delete
  5. Hy i am able to download qr code but next to qrcode there is lot if empty white space how to reduce it ?
    thank you

    ReplyDelete
    Replies
    1. We are displaying our qrcode in a div there you have to add inline css. You can use the below code.
      style="width:256px; background:#000000"

      Delete
  6. hi how to generate qr code for classic report column in oracle apex?

    ReplyDelete
  7. HI Please create a demo ho generate barcode in classic report thankyou

    ReplyDelete
  8. dear brother ,i need to store this qr code into a directory instead of download. when i generate this qr code that time it will save to target directory, is it possible? Please inform me.

    ReplyDelete
  9. can we save this qr into any directory instead of download?

    ReplyDelete
    Replies
    1. Yes, You can store this QR code in Directory through AJAX process

      Delete
  10. Hello, I want my QR code to display its name, how to do that?

    ReplyDelete

If you have any doubts, Please let me know