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?
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.
Step 2:- Create a Display QR Code Region and paste the below code into region static content. the below screenshot will help you.
<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.
Identification:- Execute Generate QR Code Function
Event:-Click
Selection Type:- Button
Button:- Generate
True Action:- Execute Javascript Code
Code:- makeCode();
For Demo:- Click Here
If You Like This Tutorial Please Like Share And Comment.
16 Comments
How am I able to download the QR code using a button?
ReplyDeleteIf You want download QR Code in your system then create a Download QR Code Function. Use below code into function and Global Declaration Section
Deletefunction 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.
Hello, I hope you're doing well.
ReplyDeleteThis code is great, congratulations, I would like to store the QR image to a blob column, is that possible?
Could you help me, please.
Yes It is possible to store the QR image to a blob column with the help of ajax process.
Deletehow to genrate 2d data matrix please
ReplyDeleteShare some more details or any example URL
DeleteHello Is it Possible to generate qr code by passing multiple values.
ReplyDeleteYes, 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.
DeleteHy i am able to download qr code but next to qrcode there is lot if empty white space how to reduce it ?
ReplyDeletethank you
We are displaying our qrcode in a div there you have to add inline css. You can use the below code.
Deletestyle="width:256px; background:#000000"
hi how to generate qr code for classic report column in oracle apex?
ReplyDeleteHI Please create a demo ho generate barcode in classic report thankyou
ReplyDeletedear 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.
ReplyDeletecan we save this qr into any directory instead of download?
ReplyDeleteYes, You can store this QR code in Directory through AJAX process
DeleteHello, I want my QR code to display its name, how to do that?
ReplyDeleteIf you have any doubts, Please let me know