Forum Stats

  • 3,769,008 Users
  • 2,252,898 Discussions
  • 7,874,840 Comments

Discussions

QR Code Generation in Forms 12c

SANPAT
SANPAT Member Posts: 1,086 Silver Badge

Dear Friends

I Need to Create a New Form and Report where want to display the QR Code capturing all the fields which are shown on Form and report . I am new to QR Code. Please guide step by step how to do it .

Sanjay

Tagged:

Best Answer

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,893 Employee
    Accepted Answer

    You first need to put Forms aside. Start by finding out how to generate a QR code and save it to a file using Java. Once you have figured out how to do that, incorporating that into your Forms app should be fairly easy. You can call the QR code generator (that you created in Java) using either the command line or by importing your Java code into Forms (using the Java Importer) and calling it directly from PL/SQL. Once your QR code has been generated to a file, you can then use the Forms built-in READ_IMAGE_FILE to load the image file into a Forms Image item, which can then be saved to the database in a BLOB column.

Answers

  • Matej D.
    Matej D. Member Posts: 1,025 Gold Trophy

    Check this document:


    How to Generate 2D Barcode / QR Code in Oracle Reports (Doc ID 1678110.1)


    Regards

  • SANPAT
    SANPAT Member Posts: 1,086 Silver Badge

    Dear Mathew

    When i am trying to get the access getting the following message :

    Your access to My Oracle Support is restricted because you currently do not have any approved active Support Identifiers in your profile

    You can request access to additional Support Identifiers with the Request Access button.

    Sanjay

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,893 Employee

    @SPathak That suggests you do not have a current Support contract with Oracle. If you believe this isn’t correct you should contact your Account Administrator.

    My suggestion, if you do not have a current Oracle Support contract, take advantage of Google. With a simple search I was able to quickly find many posts that talk about creating QR code’s using Java. Once you understand how to do that, incorporating it into Forms (or Reports) should be easy.

    Example:

    https://www.baeldung.com/java-generating-barcodes-qr-codes#5-qr-codes

  • SANPAT
    SANPAT Member Posts: 1,086 Silver Badge

    Dear Michael

    Right now I don't have any Oracle Support, I am working on Oracle Forms for my own Interest . I am creating a 12c Form where i am learning to capture the multiple fields and create the QR Code and store into the Oracle 12c Database . later in the report it should get print.

    Unable to find out any article where it will explain how to generate the QR Code using 12c Form and store in 12c oracle database.

    Please help me to Understand and improve my knowledge.

    Sanjay

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,893 Employee
    Accepted Answer

    You first need to put Forms aside. Start by finding out how to generate a QR code and save it to a file using Java. Once you have figured out how to do that, incorporating that into your Forms app should be fairly easy. You can call the QR code generator (that you created in Java) using either the command line or by importing your Java code into Forms (using the Java Importer) and calling it directly from PL/SQL. Once your QR code has been generated to a file, you can then use the Forms built-in READ_IMAGE_FILE to load the image file into a Forms Image item, which can then be saved to the database in a BLOB column.

  • Michael Ferrante-Oracle
    Michael Ferrante-Oracle Senior Principal Product Manager USMember Posts: 6,893 Employee
    edited Jul 13, 2021 4:50PM

    @SANPAT

    Someone reached out to me with a question about QR codes in Oracle Reports. Shared in that question was a public utility that generates QR codes.

    Note that I am in no way endorsing the third party site mentioned here nor am I familiar with their terms of use, so if you decide to use it be sure to carefully review their terms and do your own testing.

    So, to my point. I wondered if I could use this to display QR codes in Forms 12c. As it turns out the answer is "yes". That said, now that I've had time to think about it I really don't know why you would want to do this unless you were printing the form. Anyway, in line with what I originally suggested, consider this (12.2.1.4 required for some of the settings):

    .1. Create a form with a text field (e.g. DATA_IN). Set the max length of the field to 32767 (or some reasonable length more than 30)

    .2. Add an image item to the form (e.g. QRCODE). Make these Property changes along with any other customization you want.

    .3. Add a button (e.g. B_CREATEQR) with a WHEN-BUTTON-PRESSED trigger and this code:

    READ_IMAGE_FILE ('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=' || :DATA_IN, 'URL', 'QRCODE');

    .4. Compile and run the form. In the text field enter some text then click the button. For example,

    Hello%20world

    Note that I have to include the HTML escape character for SPACE (%20) in order to deliver it correctly. You'll likely want to add the appropriate PLSQL to do this programmatically.

    .5. Now scan the code with your phone or other device capable of translating the code. On my iPhone this is what I get:


    Of course, in order for any of this to work the Forms app will need Internet access (mid tier).