Vous êtes sur la page 1sur 10

hengkywiriawan@gmail.

com

Tutorial QR Code in Report Builder using paper layout

1. First you must get QR-Code in <file>.jar, I use QR Code demo from http://www.idautomation.com/barcode-
fonts/2d/qr-code/download.html. Klik Demo Now, to download it.

2. After Download it (IDAQRCode.jar ), you must register it to registry editor (regedit) if you want to test this
qrcode in local output Report Builder. In Registry Editor , Edit -> Find -> 'REPORTS_CLASSPATH'

Page 1 of 10
hengkywiriawan@gmail.com

3. Open Report Builder, file .rdf that you want to use QR-Code. Go to Tab Program -> Import Java Classes. Find
idautomation-qrcode. And import QRCode and QRCodeBarcodeEncoder -> Import .

Page 2 of 10
hengkywiriawan@gmail.com

Page 3 of 10
hengkywiriawan@gmail.com

4. You can see the import java classes in program units. And then we've to create Column Formula example
CF_QR_CODE that using file format as Image.

Page 4 of 10
hengkywiriawan@gmail.com

Page 5 of 10
hengkywiriawan@gmail.com

Function

function CF_QR_CODEFormula return Char is

ImageFile VarChar2(250);

/*object containing barcode properties*/

QRcodeObject ORA_JAVA.JOBJECT;

/*object that creates jpeg of barcode based on BarcodeObject*/

QRcodeEncoderObject ORA_JAVA.JOBJECT;

begin

/*Get a temporary file name for the jpeg*/

/*On Solaris Unix, use the following code to create the temp file:
ImageFile:= srw.create_temporary_filename() || '.jpg'; */

imageFile := srw.create_temporary_filename();

/*Create the barcode object*/

QRcodeObject := QRCode.new();

/*set the data to encode*/

QRCode.setDataToEncode(QRcodeObject, to_char(:invoice_num));

/*set the auto size*/

QRCode.setAutoSize(QRcodeObject,true);

/*set the custom size*/

--QRCode.setImageSize(BarcodeObject,50,50);

Page 6 of 10
hengkywiriawan@gmail.com

/*Create the jpeg*/

QRcodeEncoderObject := BarcodeEncoder.new(QRcodeObject, 'JPEG',ImageFile);

/*If, for some reason, the barcode is not created, return null

otherwise, return the name of the barcode image jpeg that was

created */

if ORA_JAVA.IS_NULL(QRcodeEncoderObject) then

return(NULL);

else

return(ImageFile);

end if;

end;

Go to paper layout and insert field, file format as Image.

Page 7 of 10
hengkywiriawan@gmail.com

Page 8 of 10
hengkywiriawan@gmail.com

Save , compile it and run paper layout.

Now we want to Register this Report with QRCode to server Oracle EBS. you must register file IDAQRCode.jar to
server.

Put the file in $ORACLE_HOME/reports/jlib/

Open Putty ->$ORACLE_HOME/reports/jlib/IDAQRCode.jar;

Register the path in reports.sh. You can use command linux find . -name reports.sh to get the path directory

example : /u02/appluat/UAT/fs1/EBSapps/10.1.2/bin

add PATH IDAQRCode.jar to REPORTS_CLASSPATH in report.sh set path to IDAQRCode.jar


($ORACLE_HOME/reports/jlib/IDAQRCode.jar)

find REPORT_CLASSPATH ,you can user vi <file>

FIND : press key ?REPORT_CLASSPATH->enter

INSERT mode : press key 'i' esc to exit from insert mode

Exit & Save : press key ':wq' ->enter

https://www.cs.colostate.edu/helpdocs/vi.html

Page 9 of 10
hengkywiriawan@gmail.com

REPORTS_CLASSPATH=$ORACLE_HOME/reports/jlib/rwbuilder.jar:$ORACLE_HOME/reports/jlib/rwrun.jar:$ORACL
E_HOME/jlib/zrclient.jar:$ORACLE_HOME/j2ee/home/oc4j.jar:$ORACLE_HOME/j2ee/home/lib/ojsp.jar:$ORACLE_
HOME/reports/jlib/IDAQRCode.jar; export REPORTS_CLASSPATH

Save it and try it to run the report in Oracle EBS.

Good Luck

Page 10 of 10

Vous aimerez peut-être aussi