HankF
|
Here is the procedure from the Oracle Report, which means it is in PL/SQL.
function CF_SHIPPING_ADVISE_ID_BCFormul return Char is
myfilename varchar2(250);
barcodeData VarChar2(80) := :SC_shipping_advise_ID;
/*name of temp file*/
ImageFile VarChar2(250);
/*object containing barcode properties*/
BarcodeObject ORA_JAVA.JOBJECT;
/*object that creates jpeg of barcode based on BarcodeObject*/
BarcodeEncoderObject ORA_JAVA.JOBJECT;
begin
-- implementation of IDAutomation linearbarcode.jar
imageFile := srw.create_temporary_filename();
/*Create the barcode object*/
BarcodeObject := Barcode.new();
/*Set the symbology*/
Barcode.setSymbologyID(BarcodeObject, Barcode.CODE128);
/*set the data to encode*/
Barcode.setDataToEncode(BarcodeObject, barcodeData);
/* Manually size the image */
Barcode.setAutoSize(BarcodeObject, FALSE);
/* Set the bar height to 2 cm */
-- Barcode.setBarHeightCM(BarcodeObject,2.0);
/* Set the small bar width to 12 cm */
Barcode.setXDimensionCM(BarcodeObject,.052);
/* set IMAGE SIZE directly */
Barcode.setImageSize(BarcodeObject, 189, 80);
/* Suppress Human-Readable */
Barcode.setShowText(BarcodeObject, FALSE);
/*Create the jpeg*/
BarcodeEncoderObject := BarcodeEncoder.new(BarcodeObject, 'JPEG',ImageFile);
/*Create the gif*/
-- BarcodeEncoderObject := BarcodeEncoder.new(BarcodeObject, 'GIF',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(BarcodeEncoderObject) then
return(NULL);
else
return(ImageFile);
end if;
END;
The setup is otherwise as prescribed for the report control for display. You can test this with any string that fits the following pattern:
YYYYSSDDDD where
YYYY is a year, eg: 2011
SS is a two-character string, eg: WM
DDDD is a four-digit "number" string, eg: 1234
The string I have been testing with is: 2012WM2925, but any and all variations on this theme are potential values for the barcodedata property. Note that this code is currently creating a JPEG image, but I have been testing both JPEG and GIF. There has been no difference in results.
The above procedure will create a barcode, but changing only the width parameter in the call to setImageSize( 190, 80) will cause it to fail to create an image. At least, that is what I assume it fails on since I get an error from the report that this function failed to return a value.
Thanks for your efforts.
HankF
Posted 12 year(s) ago
|