<b><font color="blue">Interleaved 2 of 5 in Oracle reports</font id="blue"></b>
To use Interleaved 2 of 5 in Oracle reports is not as simple as 3 of 9 and you need a procedure to do so. Few years back I had developed a procedure and now you can use 2 of 5 very easily after using it.
Step 1
Get Interleaved barcode font for windows and install on your machine.
Step 2
Create the following function in your schema,
CREATE OR REPLACE FUNCTION barcode25 (p_data VARCHAR)
RETURN VARCHAR
IS
barcode_data VARCHAR2 (6);
DATA VARCHAR2 (8) DEFAULT LPAD (p_data, 8, 0);
BEGIN
--Script required for Barcode Interleaved 2 of 5 in Oracle
--
www.erpstuff.com
--Sikandar Hayat
--18/03/2002
--------------------------------------------------------------------
--Take the pairs of data and get the ASCHII value
FOR i IN 1 .. LENGTH (DATA)
LOOP
IF MOD (i, 2) = 1
THEN
IF SUBSTR (DATA, i, 2) < 90
THEN
barcode_data := barcode_data || CHR (SUBSTR (DATA, i, 2) + 33);
ELSE
barcode_data := barcode_data || CHR (SUBSTR (DATA, i, 2) + 71);
END IF;
END IF;
END LOOP;
RETURN ('{' || barcode_data || '}');
END;
/
Step 3
Create a report while using the following query as sample,
SELECT barcode25 ('12345678')
FROM DUAL;
Step 4
Change the font of your field in reports to Barcode 2 of 5.
Step 5
Execute the report and print the barcode after adjusting the size you want it to be.
Step 6
Scan it and it should display the same data you used in your query.
Note: The above procedure will be used for length upto 8.
Let me know if still any issue.