日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

EBS条形码打印

發布時間:2025/3/20 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 EBS条形码打印 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Oracle? 提供兩種方式實現 128 碼的編碼
第一種方式是使用 Reports Builder 實現對 128 碼編碼, 在 Metalink 305090.1[1]? 有
比較詳盡的描述,其中的 IDAUTOMATION.PLL 中包含方法 Code128A, Code128B
及 Code128C 分別實現了 A,B,C 類 128 碼的編碼。具體的實現方法請參照 MetaLink
305090.1? 。
第二種方法是通過 XML Publisher 實現 128 碼的編碼。因為超過 128? 的 ASCII 碼對
應的特殊字符在 PL/SQL 中無法顯示,但是在 128 碼中使用這些字符作為 128 碼的
起始終止位以及校驗位,編碼的過程放在 PL/SQL 端實現并生成 XML 數據結合模板
生成條碼較難實現。改變思路,我們把編碼過程放在 JAVA 類中,通過在結合模板
時調用生成 128 碼就可以實現條碼的生成和打印。在《Oracle XML Publisher
Administration and Developer's Guide》中 Advanced Barcode Font Formatting
Implementation? 中提供了這種方法的實現。在 Metalink 782809.1[2]中提供 JAVA 版
128 碼編碼實現類(BarcodeUtil.java)的下載,以及測試使用相應的模板文件

(TestBarcodeUtil.rtf)


以下內容以字體IDAutomationC128M 為演示


一.WINDOWS本地字體配置

下載條形碼字體,復制到系統字體文件夾里,自動安裝


二,上傳java到服務器

1.查看java里路徑? 例如:package oracle.apps.xdo.template.rtf.util.barcoder;

上傳java文件BarcodeUtil.java到目錄? $JAVA_TOP/oracle/apps/xdo/template/rtf/util/barcoder 沒有新建


編譯java文件

java文件如下

/*Code extracted from Oracle?XML Publisher Core Components GuideRelease 10.1.3.3Pages 8-60 to 8-64 */package oracle.apps.xdo.template.rtf.util.barcoder;import java.util.Hashtable; import java.lang.reflect.Method; import oracle.apps.xdo.template.rtf.util.XDOBarcodeEncoder; import oracle.apps.xdo.common.log.Logger;// This class name will be used in the register vendor // field in the template.public class BarcodeUtil implements XDOBarcodeEncoder // The class implements the XDOBarcodeEncoder interface {// This is the barcode vendor id that is used in the// register vendor field and format-barcode fieldspublic static final String BARCODE_VENDOR_ID = "XMLPBarVendor";// The hashtable is used to store references to// the encoding methodspublic static final Hashtable ENCODERS = new Hashtable(10);// The BarcodeUtil class needs to be instantiatedpublic static final BarcodeUtil mUtility = new BarcodeUtil();// This is the main code that is executed in the class,// it is loading the methods for the encoding into the hashtable.// In this case we are loading the three code128 encoding// methods we have created.static {try {Class[] clazz = new Class[] { "".getClass() };ENCODERS.put("code128a",mUtility.getClass().getMethod("code128a", clazz));ENCODERS.put("code128b",mUtility.getClass().getMethod("code128b", clazz));ENCODERS.put("code128c",mUtility.getClass().getMethod("code128c", clazz));} catch (Exception e) {// This is using the XML Publisher logging class to push// errors to the XMLP log file.Logger.log(e,5);}}// The getVendorID method is called from the template layer// at runtime to ensure the correct encoding method are usedpublic final String getVendorID(){return BARCODE_VENDOR_ID;}//The isSupported method is called to ensure that the// encoding method called from the template is actually// present in this class.// If not then XMLP will report this in the log.public final boolean isSupported(String s){if(s != null)return ENCODERS.containsKey(s.trim().toLowerCase());elsereturn false;}// The encode method is called to then call the appropriate// encoding method, in this example the code128a/b/c methods.public final String encode(String s, String s1){if(s != null && s1 != null){try {Method method = (Method)ENCODERS.get(s1.trim().toLowerCase());if(method != null)return (String)method.invoke(this, new Object[] { s });elsereturn s;}catch(Exception exception){Logger.log(exception,5);}return s;} else {return s;}}/** This is the complete method for Code128a */public static final String code128a( String DataToEncode ){char C128_Start = (char)203;char C128_Stop = (char)206;String Printable_string = "";char CurrentChar;int CurrentValue=0;int weightedTotal=0;int CheckDigitValue=0;char C128_CheckDigit='w';DataToEncode = DataToEncode.trim();weightedTotal = ((int)C128_Start) - 100;for( int i = 1; i <= DataToEncode.length(); i++ ){//get the value of each characterCurrentChar = DataToEncode.charAt(i-1);if( ((int)CurrentChar) < 135 )CurrentValue = ((int)CurrentChar) - 32;if( ((int)CurrentChar) > 134 )CurrentValue = ((int)CurrentChar) - 100;CurrentValue = CurrentValue * i;weightedTotal = weightedTotal + CurrentValue;}//divide the WeightedTotal by 103 and get the remainder,//this is the CheckDigitValueCheckDigitValue = weightedTotal % 103;if( (CheckDigitValue < 95) && (CheckDigitValue > 0) )C128_CheckDigit = (char)(CheckDigitValue + 32);if( CheckDigitValue > 94 )C128_CheckDigit = (char)(CheckDigitValue + 100);if( CheckDigitValue == 0 ){C128_CheckDigit = (char)194;}Printable_string = C128_Start + DataToEncode + C128_CheckDigit + C128_Stop + " ";return Printable_string;}/** This is the complete method for Code128b ***/public static final String code128b( String DataToEncode ){char C128_Start = (char)204;char C128_Stop = (char)206;String Printable_string = "";char CurrentChar;int CurrentValue=0;int weightedTotal=0;int CheckDigitValue=0;char C128_CheckDigit='w';DataToEncode = DataToEncode.trim();weightedTotal = ((int)C128_Start) - 100;for( int i = 1; i <= DataToEncode.length(); i++ ){//get the value of each characterCurrentChar = DataToEncode.charAt(i-1);if( ((int)CurrentChar) < 135 )CurrentValue = ((int)CurrentChar) - 32;if( ((int)CurrentChar) > 134 )CurrentValue = ((int)CurrentChar) - 100;CurrentValue = CurrentValue * i;weightedTotal = weightedTotal + CurrentValue;}//divide the WeightedTotal by 103 and get the remainder,//this is the CheckDigitValueCheckDigitValue = weightedTotal % 103;if( (CheckDigitValue < 95) && (CheckDigitValue > 0) )C128_CheckDigit = (char)(CheckDigitValue + 32);if( CheckDigitValue > 94 )C128_CheckDigit = (char)(CheckDigitValue + 100);if( CheckDigitValue == 0 ){C128_CheckDigit = (char)194;}Printable_string = C128_Start + DataToEncode + C128_CheckDigit + C128_Stop + " ";return Printable_string;}/** This is the complete method for Code128c **/public static final String code128c( String s ){char C128_Start = (char)205;char C128_Stop = (char)206;String Printable_string = "";String DataToPrint = "";String OnlyCorrectData = "";int i=1;int CurrentChar=0;int CurrentValue=0;int weightedTotal=0;int CheckDigitValue=0;char C128_CheckDigit='w';DataToPrint = "";s = s.trim();for(i = 1; i <= s.length(); i++ ){//Add only numbers to OnlyCorrectData stringCurrentChar = (int)s.charAt(i-1);if((CurrentChar < 58) && (CurrentChar > 47)){OnlyCorrectData = OnlyCorrectData + (char)s.charAt(i-1);}}s = OnlyCorrectData;//Check for an even number of digits, add 0 if not evenif( (s.length() % 2) == 1 ){s = "0" + s;}//<<<< Calculate Modulo 103 Check Digit and generate// DataToPrint >>>>//Set WeightedTotal to the Code 128 value of// the start characterweightedTotal = ((int)C128_Start) - 100;int WeightValue = 1;for( i = 1; i <= s.length(); i += 2 ){//Get the value of each number pair (ex: 5 and 6 = 5*10+6 =56) //And assign the ASCII values to DataToPrintCurrentChar = ((((int)s.charAt(i-1))-48)*10) + (((int)s.charAt(i))-48);if((CurrentChar < 95) && (CurrentChar > 0))DataToPrint = DataToPrint + (char)(CurrentChar + 32);if( CurrentChar > 94 )DataToPrint = DataToPrint + (char)(CurrentChar + 100);if( CurrentChar == 0)DataToPrint = DataToPrint + (char)194;//multiply by the weighting character//add the values together to get the weighted totalweightedTotal = weightedTotal + (CurrentChar * WeightValue);WeightValue = WeightValue + 1;}//divide the WeightedTotal by 103 and get the remainder,//this is the CheckDigitValueCheckDigitValue = weightedTotal % 103;if((CheckDigitValue < 95) && (CheckDigitValue > 0))C128_CheckDigit = (char)(CheckDigitValue + 32);if( CheckDigitValue > 94 )C128_CheckDigit = (char)(CheckDigitValue + 100);if( CheckDigitValue == 0 ){C128_CheckDigit = (char)194;}Printable_string = C128_Start + DataToPrint + C128_CheckDigit + C128_Stop + " ";Logger.log(Printable_string,5);return Printable_string;} } /*End BarcodeUtil class */
三,生成xml數據源

舉例如下

<?xml version="1.0" encoding="UTF-8"?> <RECEIPT_APPLIED> <LINES> <ITEM_CODE>F4990010010</ITEM_CODE> <ITEM_NAME><![CDATA[財稅通軟件 V1.0]]></ITEM_NAME> <BARCODE>912014266</BARCODE> </LINES> <LINES> <ITEM_CODE>F4990010010</ITEM_CODE> <ITEM_NAME><![CDATA[財稅通軟件 V1.0]]></ITEM_NAME> <BARCODE>912014265</BARCODE> </LINES> </RECEIPT_APPLIED>
四.根據數據源制作模板

說明:REG里面?? <?register-barcode-vendor:'oracle.apps.xdo.template.rtf.util.barcoder.BarcodeUtil';'XMLPBarVendor'?> 注冊條碼編碼類

?????????? 條碼里??????? <?format-barcode:BARCODE;'Code128a';'XMLPBarVendor'?>??? 數據格式化


五.注冊數據源,模板


六.上傳字體

在XML Publisher Administrator職責下,首先上傳字體文件



七.配置字體映射

在XML Publisher Administrator職責下,定義字體轉換映射集

由于我們的模板使用的是RTF格式的,因此Type需要選擇FO To PDF


在XML Publisher Administrator職責下,定義字體轉換映射關系

輸入Font Family,這個值可以打開字體文件來查看

根據模板中使用字體的情況來選擇Style和Weight

如果需要根據Locale來決定使用字體映射,則填入Language和Territory,不填代表所有語音環境下都適用




八,模板和字體映射關聯

定義好字體映射之后,修改BIP模板文件的配置

查詢出BIP模板定義后,點擊右上角的 Edit Configuration 按鈕


查找模板

展開FO Processing部分,設置Font mapping set為上面定義好的字體映射集


最后提交請求,查看輸出



附1:metalink

In this Document

Purpose
?Scope
?Details
?Overview
?Limitation
?Steps to Implement
?EnterpriseOne 8.98.3.0 and later (including 9.1):
?EnterpriseOne 8.98.2.4 and older:
?References

APPLIES TO:

JD Edwards EnterpriseOne Tools - Version 8.97 and later
BI Publisher (formerly XML Publisher) - Version 11.1.1.5.0 to 11.1.1.5.0 [Release 11.1]
Information in this document applies to any platform.

PURPOSE

Information Center: BI Publisher in the JD Edwards EnterpriseOne Tools and Technology Product?>?Information Center: Using BI Publisher in the JD Edwards EnterpriseOne Tools and Technology Product?> Note 1460779.2

This document outlines the steps to use barcode java handlers to add control characters to barcode content in reports produced by embedded BI Publisher for EnterpriseOne.

SCOPE

Embedded BI Publisher for EnterpriseOne.

DETAILS

Overview

Barcodes are a representation of a string of data in a barcode font. In order to be readable by barcode scanners, data represented in barcode format need to be preceded and followed by their respective control characters. See external page?http://en.wikipedia.org/wiki/Code_128?for more information.?

This can be archived in BI Publisher by invoking a java handler within the RTF template. The process works in two steps. First the BI Publisher engine merges the XML data with the template when submitting the report definition. Second the RTF template itself invokes the barcode java handler at runtime to add the control characters to the barcode string.

Limitation

Barcode encoding will not work if using a PDF type template with Embedded BI Publisher for EnterpriseOne. This is because there is no way to add the necessary call to the java script to enable the start and stop control characters in PDF templates and this can only be done in RTF templates. Without the java script, the font will show in the final output, however it will be unreadable to the barcode scanners.

Steps to Implement

EnterpriseOne 8.98.3.0 and later (including 9.1):

Since tools release 8.98.3.0 we include a newer BI Publisher core engine (10.1.3.4.1) which has built in support for barcode 128a,b,c. The barcode function can be invoked directly using te following command in your RTF template:

<?format-barcode:FieldName;'code128b'?>

Where FieldName is the name of the dynamic field you want to convert to Barcode 128b.

You can use encodings 128a and 128c as well, for example:

<?format-barcode:FieldName;'code128a'?>
<?format-barcode:FieldName;'code128c'?>

You may also want to try to use the barcode 128 font delivered with BI Publisher Desktop:?128R00.TTF. See article posted inhttps://blogs.oracle.com/xmlpublisher/entry/bundled_barcodes_batman_1?for more details.

EnterpriseOne 8.98.2.4 and older:

The following steps layout all pieces necessary to embed readable barcode strings in reports produced by BI Publisher for EnterpriseOne 8.98.2.4 and older.

The implementation of this solution requires knowledge of BI Publisher for EnterpriseOne and java programming language.

?

  • ?Obtain a java handler from the barcode vendor

    A sample of a barcode handler code is provided in the Oracle XML Publisher - Core Components Guide - Release 10.1.3.3 - Pages 8-60 to 8-64 (Document 704542.1) and included in the attachment?BarcodeUtil.java

    This source file is provided only as a reference. The actual code should be provided by the barcode font vendor. Oracle does not support the creation?or customization of the barcode java handler.
    ??
  • The java handler must contain three methods to be called by BI Publisher engine:

    getVendorID();
    isSupported(String type);
    encode(String data, String type);
    ?
  • Take note of the package location specified in the java source (usually the first line)

    Example:?package oracle.apps.xdo.template.rtf.util.barcoder;
    ?
  • Check the Java Runtime Environment (JRE) in use on the enterprise server where E1 XML PUBLISHER kernel runs. Login as the user who starts E1 services and issue command?java -version?from a command console.

    Note about AS/400:?the Enterprise Server Minimum Technical Requirements referenced in?document 747323.1?contains information about the necessary Java Developer Kit installed on this server platform.
    ?
  • Copy?xdocore.jar?file from EnterpriseOne enterprise server located in '..\system\classes' folder to a development workstation. Extract it using a tool such WinZip. Example:?c:\temp
    ?
  • Compile?BarcodeUtil.java?using the?same?JRE version used on the enterprise server. So for instance, if in step 4 you found java version 1.4.2_05, use JDK 1.4.2 update 5 or greater to compile the java class.

    Problems might appear if the class is compiled using a major Java release different than the one on the Enterprise Server (the machine that will execute the java compiled code at runtime).

    Example: if you are compiling it on Windows development workstation where c:\temp contains the java source file, the JDK and xdocore.jar, you can use the following commands:

    set path=c:\temp\jdk_1.4.2_18\bin
    set classpath=c:\temp\xdocore.jar
    javac -g BarcodeUtil.java

    If there are no major problems with the code, this will create a file name?BarcodeUtil.class?inside c:\temp

    Note: In situations where a version of the JDK used on the server is not available on the Windows platform, follow the procedures in steps 5 and 6 on the enterprise server itself. This is usually the case with AIX and iSeries servers which use IBM J9 JDK.

    This information is provided only as a reference. Problems setting java compiler environment and with the compilation of the barcode java handler provided by 3rd party vendors are not supported by Oracle. Please refer to the respective vendor for further assistance.
    ?
  • Copy the new BarcodeUtil.class to the uncompressed structure of xdocore.jar you extracted in step 5. Place it in the same location given by the 'package' directive specified in the java source and found in step 3.?

    Example: if the java source contains:

    package oracle.apps.xdo.template.rtf.util.barcoder;

    place?BarcodeUtil.class?in folder name 'oracle\apps\xdo\template\rtf\util\barcoder' inside the extracted xdocore.
    ?
  • Compress all class files (which must include the new?BarcodeUtil.class?you added in step 7) into a jar file and name it?xdocore.jar. You can use WinZip to create?xdocore.zip?and then rename it to?xdocore.jar.

    Make sure you only?compress the original folder structure, not any additional upper folder level. Check this by opening the original?xdocore.jarand the new?xdocore.jar?files with a zip utility and comparing the folder structure.
    ?
  • Stop EnterpriseOne services on the enterprise server and backup the original?xdocore.jar?inside?...\system\classes.?Place the backup in a folder outside the system?PATH?and?CLASSPATH?folders otherwise the system might still use the old?.jar?file.
    ?
  • Copy?xdocore.jar?file created in step 8 to the enterprise server placing it in?...\system\classes
    ?
  • Take this opportunity to check you can find the jas and jasroot log files produced by EnterpriseOne JVM based kernels - See?Document 651589.1section 'jas/jasroot/jasdebug'. The location where these logs are saved is configured in file?jdelog.properties?found in?? ...\system\classes (on AS/400 it is in ...\system). Edit it and check if the parameter FILE points to the same folder where other E1 kernel logs are saved.

    These logs are helpful when troubleshooting BI Publisher issues.
    ?
  • Review the?document 652457.1?to learn how to configure the barcode font in?xdo.cfg?file. Then configure the server?xdo.cfg?and copy the barcode truetype font to the enterprise server.
    ?
  • Start EnterpriseOne services on the enterprise server.
    ?
  • Install the font on the development workstation. This should be the same font you uploaded to the enterprise server in step 12. All it usually takes is to copy the truetype font to the 'fonts' folder inside?C:\WINDOWS.
    ?
  • Create a new template containing the following:
    ?
    • Directive to register the barcode handler (note the java path must match the location of the class file in?xdocore.jar?as explained in item 7):

      For example:

      <?register-barcode-vendor:'oracle.apps.xdo.template.rtf.util.barcoder.BarcodeUtil';'XMLPBarVendor'?>
    • Invoke the handler using the 'format-barcode' directive:

      For example:

      <?format-barcode:xml_field_name;'code128b';'XMLPBarVendor'?>

      See section titled?Register the Barcode Encoding Class?in the?Oracle XML Publisher Core Components guide page 2-118 and 2-119?for more information see?document 704542.1

      See attached file?TestBarcodeUtil.rtf?for a sample template.
      ?
  • On the template, change the font of the data field to be encoded to be displayed using the barcode font you installed in step 14.
    ?
  • Create a BI Publisher object using program?P95600, upload the template you created in step 15, then create a report definition and associate it to the BI Publisher object. Submit it to the server and check the status of the output; it should be 'D' for done. If you get a status 'FX' this means that an error occurred when merging data and template. If that happened, check the jas log you setup in step 11 and look for errors. Normally java exceptions in the log will tell where the error occurred.?
    ?
  • To verify that the java handler class is being called correctly, change the font on the data field to a humanly readable font, say Arial and run the report definition again. In the final output you should see the encoded value of the data formatted by the barcode handler.?

    If the output is the same as the data in the XML field then the BarcodeUtil handler is not being called correctly.

  • Below is a screenshot showing the output obtained using the steps above on EnterpriseOne 9.0 with tools release 8.98.2.4:

    Note 1:
    The same result can be achieved with BI Publisher Desktop (MS Word Plug-in), using its own xdocore.jar and its fonts. These are usually located in"c:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word", in the?jlib?and?fonts?subfolders.

    If the issue is duplicated with the Desktop Plugin, then it is?not an EnterpriseOne integration problem, and the cause should be sought either in the encryptor class from the barcode provider, or in the way it was integrated in the BarcodeUtil.java.

    ?

    Note 2:?
    There are many different types of barcodes. This document is specific to handling of 128a, 128b and 128c types.?

    It is possible to integrate other dynamic barcode types to use with BI Publisher for EnterpriseOne, however these are considered to be out of the scope of EnterpriseOne support.?

    If you have questions about using 2D barcode fonts you may like to consider the following links:?

    https://blogs.oracle.com/xmlpublisher/entry/bundled_barcodes_batman_1?
    https://blogs.oracle.com/xmlpublisher/entry/2d_barcodes_cracked
    https://blogs.oracle.com/xmlpublisher/entry/2d_barcode_addendum
    http://www.idautomation.com/oracle/xml_publisher_barcode.html.

    Discussion and tips on how to incorporate QR barcodes:
    https://blogs.oracle.com/xmlpublisher/entry/quick_quips_on_qr_codes

    Enhancement bugs requesting enhanced support for barcodes:
    BUG 11047749?- SUPPORT 2D BARCODE PRINTING

    ?

    REFERENCES

    NOTE:652457.1?- E1: XMLP: Adding a Font to be Used with Embedded Publisher for EnterpriseOne
    NOTE:747323.1?- JD Edwards EnterpriseOne Current MTR Index
    NOTE:651589.1?- E1: XMLP: How to Capture BI Publisher Logs
    NOTE:789074.1?- E1: XMLP: BI Publisher for JD Edwards EnterpriseOne
    NOTE:704542.1?- JD Edwards EnterpriseOne Tools 8.97 Implementation of Oracle Business Intelligence (BI) Publisher (Formerly XML Publisher)
    BUG:11047749?- SUPPORT 2D BARCODE PRINTING - SAR: 8967722

    文檔詳細信息

    ?
    ?
    ?類型:
    ?狀態:
    ?上次主更新:
    ?上次更新:
    ?
    ?BULLETIN
    ?PUBLISHED
    ?2014-4-10
    ?2014-6-11
    ? ? ?
    ?

    相關產品

    ?
    JD Edwards EnterpriseOne Tools BI Publisher (formerly XML Publisher)
    ? ? ?
    ?

    信息中心

    ?
    ?? Information Center: JD Edwards EnterpriseOne Tools and Technology Product [1415663.2] E-Business Suite Product Information Center Index [444.2]
    ? ? ?
    ?

    文檔引用

    ?
    ?? E1: XMLP: Adding a Font to be Used with Embedded Publisher for EnterpriseOne [652457.1] JD Edwards EnterpriseOne Current MTR Index [747323.1] E1: XMLP: How to Capture BI Publisher Logs [651589.1] E1: XMLP: BI Publisher for JD Edwards EnterpriseOne [789074.1] JD Edwards EnterpriseOne Tools 8.97 Implementation of Oracle Business Intelligence (BI) Publisher (Formerly XML Publisher) [704542.1]
    ? ? ?
    ?

    最近查看

    ?
    E1: XMLP: Barcode Encoding with BI Publisher for EnterpriseOne [782809.1]
    How to Create a Report with IDAutomationC128M Barcode Font [305090.1]
    Ship Confirm Warning: A Valid Document Category Does Not Exist [219923.1]
    Attempting to Assign Ship Method and Org to Existing Freight Carrier Errors with App-Wsh-231106-Unexpected Error Pos 20 Updating Wsh_org_carrier_services [730693.1]
    Which parameter names are supported in Shipping Document sets ? [1079914.1]
    顯示更多
    ? ? ?
    ?
    ?

    附件

    ??
    ?
    • BarcodeUtil.java(9.08 KB)
    • TestBarcodeUtil.rtf(30.54 KB)


    附2:report 實現

    Oracle Reports Barcode Tutorial & FAQ

    How to Create a Barcode in Oracle Reports?

    View Video Full Screen on YouTube

    This IDAutomation tutorial should be used when implementing barcode generation in Oracle Reports with the IDAutomation PL/SQL Barcode Library and IDAutomation barcode fonts. The barcode library is a PLL file that formats data from fields in the report to create an accurate barcode when combined with IDAutomation barcode fonts.

    The library contains functions for Code 128, Code 39, GS1, Codabar, UCC/EAN 128, Interleaved 2 of 5, UPC and EAN barcodes.

    IDAutomation also provides?Java barcode generation for Oracle Reports, which is easier to implement in for versions 9i, 10g and above, as well as in UNIX and Linux environments. Other solutions are also provided in the?Oracle Reports Barcode Integration Guide.

    Note:?Use of this pll, requires a Developer License or above. This font encoder is supplied with Purchase of Developer's License or above of any Barcode Font Package.

    Oracle Barcode Font Implementation Tutorial

    Step 1: Install the Barcode Fonts

    IDAutomation offers many different?barcode fonts?for a variety of purposes. If unsure which to use, consider theUniversal Barcode Font?with the?Code 128 function. The IDAutomation.pll is a Feature Level 3 font encoder and cannot format data for the GS1-128 barcode standard. The IDAutomation_Universal.pll (compatible with Oracle 9i and above) can encode data for GS1-128 barcodes. To install these barcode fonts on Windows for Oracle Reports, run theInstall.exe?file included in the font package or follow the?font installation procedures. Because of the complexities and variety of UNIX and Linux system distributions, IDAutomation does not provide installation assistance for these systems. However, IDAutomation does provide two sets of installation instructions that may help as a guide:

  • Installing Fonts on Unix for Oracle Reports
  • Font Installation on Unix and Other Systems
  • If possible, consider using?Java Barcoding for Oracle Reports?for Unix and Linux environments.

    Step 2: Install the Oracle Reports Barcode PLL Library

    The Oracle Reports Barcode PLL Library is compatible with all versions of Oracle Reports that support attached libraries. The?IDAutomation.pll?was developed and tested against Reports 6i, and the?IDAutomation_Universal.pll?is compatible with 10g and above. If used in the database itself, the version of the database would be any version that supports PL/SQL. PL/SQL source code is also provided for advanced Oracle developers in the?IDAutomation.pkg?file.

  • Open Oracle Reports Builder.
  • Open the report rdf file that will contain the barcodes.
  • Select the attached libraries option.
  • Press the create button (Green Plus symbol) on the left toolbar.?
  • In the dialog box, select the?File System?radio button, click on the?Browse?button.?
  • Included in the Developer Tool's folder of the licensed font package will be the Oracle Barcode Library Tool, which contains the?IDAutomation.pll?and?IDAutomation_Universal.pll?files. After decompressing, save these files to an appropriate directory.
  • Select the?IDAutomation.pll?or the?IDAutomation_Universal.pll?file and choose the?Attach?button. If not sure which to use, consider the?IDAutomation_Universal.pll?file with the?IDAutomation Universal Barcode Font.
  • A dialog box will appear asking to remove the path. If?Yes?is selected, the PL/SQL library will need to be reattached to the report every time the report is opened. If?No?is selected, it will always look for the path in the same location. Leaving the library in the same directory as the report is encouraged.
  • The barcode functions in the library are now ready to be used in the report. After the library is attached, the?Object Navigator?should look similar to the screen shot below, which shows the attached?IDAutomation_Universal.pll.
    ?
  • Step 3: Set Up the Function Call with the Barcode Font
  • IDAutomation's barcode library contains many?font functions?for linear barcodes. Add a?Formula Column?to the report by using the?Data Model?option of the?Report Layout, clicking the?Formula Column?button on the toolbar, and sizing the column in the layout area.

  • The newly added Formula Column properties need to be adjusted to call the PL/SQL function from theIDAutomation.pll?library. Access the property page for the?Formula Column?by selecting the?Formula Column?and pressing the?F4?key. The following window will appear:

  • Adjust the following properties:
  • Name: Choose a descriptive name for the?Formula Column?because the columns will need to be referenced when designing the layout of the actual report.
  • Datatype: This must be selected as?Character?from the drop-down menu.
  • Width: Ensure the width of the field is large enough to hold all encoded characters.
  • Click on the?PL/SQL Formula?button within the?Property Inspector?to call the appropriate barcode function. The following screen should appear:

  • Insert the appropriate function call where the cursor is positioned within the report to add the appropriate start and stop characters, encode the data if necessary and add the check sum character, when required.

  • In the above example, a constant value?(Code128Test)?was passed into this function. If necessary, the appropriate character field may be substituted from the database.
  • Click?Close?in the above window and ensure the report has been saved.
  • To add this?Formula Column?to the report, switch to?Paper Layout?mode for the report and add a?Field object?to the report by clicking the appropriate item in the toolbar and dragging into position on the report.

  • Once the?Field?has been added to the report, link it to the?Formula Column?that was created earlier. To link theField?to the?Formula Column, select the field and hit the?F4?button to bring up the?Property Inspector?for the Field. The Property Inspector should look similar to the following:

  • Adjust the following properties:
  • Name: Choose a descriptive name for the field?(optional).
  • Source: Select the name of Formula Column that was created earlier?(required).?
  • Modify the font of the field to the appropriate barcode font according to the Oracle Reports Barcode Font Functions chart below.
  • Oracle Reports?Barcode Font Functions
    The?methods listed below may only be used with?IDAutomation.pll?and the appropriate barcode font. IDAutomation strongly recommends using the?Universal Barcode Font?with the appropriate?Universal Function?when generating Code 128 or Interleaved 2 of 5 barcodes.
    Function Font Name Function Notes and Additional Information
    Code128
    (DataToEncode,?ReturnType)
    IDAutomationC128?* Automatically encodes text data from ASCII 1 to ASCII 127.??Using the?Universal Barcode Font?with the?Universal Font Methods?in the following situations is recommended:
    • When the IDAutomationC128 font is used outside of the USA to avoid language and locale incompatibilities.
    • When creating barcodes for GS1-128 (UCC/EAN 128) or when encoding FNC1 or FNC2 functions.
    • When encoding functions such as the return or tab.

    It may be necessary to use the optional ReturnType for special purposes:

    (Data, 0) formats barcode output string for Code 128 barcode fonts.
    (Data, 1) returns the human-readable data.
    (Data, 2) returns only the check digit.

    Code128a(DataToEncode) IDAutomationC128?* Formats output to the Code 128 barcode fonts, character set A.
    Code128b(DataToEncode) IDAutomationC128?* Returns codes formatted to the Code 128 character set B. Formats output to the Code 128 barcode fonts.
    Code128c(DataToEncode) IDAutomationC128?* Interleaves numbers into pairs for high density.
    I2of5
    (DataToEncode)
    IDAutomationI25?*
    IDAutomationI25?*
    Interleaves numbers into pairs for high density without check digits, and formats the return string to the Interleaved 2 of 5 barcode fonts.
    I2of5Mod10(DataToEncode,ReturnType) IDAutomationI25?*
    IDAutomationI25?*
    (DataToEncode, 0)?performs the mod10 checksum calculation for increased accuracy and formats the return string to the Interleaved 2 of 5 barcode fonts.?
    (DataToEncode, 1)?returns the human-readable data with the MOD10 check digit included.
    (DataToEncode, 2)?returns the MOD10 check digit.
    * When using the IDAutomationC128 or IDAutomationI25 fonts?outside of the USA or for GS1-128, consider using theUniversal Barcode Font?with the appropriate?Universal Function?to avoid language and locale incompatibilities.
    Code39Mod43(DataToEncode,ReturnType) IDAutomationC39
    IDAutomationC39
    (DataToEncode, 0)?performs the mod43 checksum calculation for increased accuracy and formats the output to print using Code 39 fonts. The mod43 checksum is usually required for LOGMARS and HIBC applications.
    (DataToEncode, 1)?returns the human readable data with the check digit included.
    (DataToEncode, 2)?returns only the check digit.
    Code93
    (DataToEncode)
    IDAutomationC93 Formats the output to print with the 2 required check digits using Code 93 fonts.
    Codabar(DataToEncode) IDAutomationCB Formats the output to print using Codabar fonts.
    EAN13
    (DataToEncode)
    IDAutomationUPCEAN A number string of 12, 13, 14, 15, 17 or 18 digits with or without a check digit. Formats output to the UPC/EAN fonts. Add-ons are supported.
    EAN8
    (DataToEncode)
    IDAutomationUPCEAN A number string of 7 or 8 characters (EAN-8 without the check digit). Formats output to the UPC/EAN fonts. Entering incorrect data will create a barcode containing all zeros.
    Postnet
    (DataToEncode,
    ReturnType)
    IDAutomationPOSTNET
    or
    IDAutomationPOSTNET
    Enter a single string of Zip, Zip + 4 or Zip + 4 + Delivery Point or any number of digits for the planet code. The DataToEncode must be a number and can include dashes and spaces.

    (DataToEncode, 0)?formats output to the Postnet fonts.
    (DataToEncode, 1)?returns the human-readable data with the check digit included.
    (DataToEncode, 2)?returns only the check digit.
    UPCa
    (DataToEncode)
    IDAutomationUPCEAN A UPC-A number string of 11, 12, 13, 14, 16 or 17 digits with or without a check digit. Formats output to the UPC/EAN fonts. Add-ons are supported.
    Oracle Reports?Universal Barcode Font Functions
    These?methods may only be used with?IDAutomation_Universal.pll?and the?Universal Barcode Fonts.
    Function Font Name Function Notes
    Code128(DataToEncode,ApplyTilde) IDAutomation_Uni Automatically encodes all text from ASCII 1 to ASCII 127. This method contains many options for?encoding GS1-128?and includes tilde options to encode functions such as tabs and returns.
    Code128A(DataToEncode) IDAutomation_Uni Formats output to set A of Code-128. Use caution with this option because any lowercase character creates a function. Use the letter "i" for a tab and "m" for a return. For most purposes, it is better to use the?C128() function?instead of this one.
    Code128B(DataToEncode) IDAutomation_Uni Formats output to Code-128, character set B. For most purposes, it is better to use theC128() function?instead of this one.
    Code128C(DataToEncode) IDAutomation_Uni This code128 function "interleaves" even numbers into pairs for high density. An even number of digits is required. For most purposes, it is better to use the?C128() functioninstead of this one.
    Code39
    (DataToEncode,?N_Dimension,IncludeCheckDigit)
    IDAutomation_Uni Formats the output to Code 39 with the Universal barcode font. A MOD 43 checksum will be calculated if IncludeCheckDigit is true.
    Codabar(DataToEncode,N_Dimension,?StartChar,
    StopChar)
    IDAutomation_Uni Creates Codabar (aka NW7) with the Universal barcode font. StartChar and StopChar are also required as the start and stop characters. Valid start and stop characters are A, B, C and D.
    I2of5
    (DataToEncode,?N_Dimension,IncludeCheckDigit)
    IDAutomation_Uni Interleaves numbers into pairs for high density without check digits, and formats the return string to the Universal font. An even number of digits is required. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.
    Planet
    (DataToEncode,IncludeCheckDigit)
    IDAutomation_Uni This barcode type has a specific height requirement, and this function only works with the XS, S or M size of the Universal Font.

    XS?is the normal version,?S?has the bars narrow by 10% and the?M?font has the bars narrow by 20%. DataToEncode is a single string of Zip, Zip + 4 or Zip + 4 + Delivery Point. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.

    Postnet
    (DataToEncode,IncludeCheckDigit)
    IDAutomation_Uni This barcode type has a specific height requirement, and this function only works with the XS, S or M size of the Universal Font.?XS?is the normal version,?S?has the bars narrow by 10% and the?M?font has the bars narrow by 20%. DataToEncode is a single string of Zip, Zip + 4 or Zip + 4 + Delivery Point. A MOD 10 checksum will be calculated if IncludeCheckDigit is true.

    Function Property?Descriptions

    • DataToEncode: A string value that represents the data being encoded.
    • N_Dimension: Determines the width of the wide bars which is a multiple of the X dimension. Valid values are 2, 2.5 and 3. The default is 2. The X dimension is determined by the font point size.
    • IncludeCheckDigit: A Boolean value that determines whether a check digit should be automatically calculated and included for the DataToEncode.
    • ApplyTilde: If set to?True, characters following the tilde may be used to?perform additional calculations?or?encode ASCII characters directly.
    Related Links:
    • Barcode Integration Guide and Tutorial for Oracle Reports
    • Oracle Technology Network




    轉載于:https://www.cnblogs.com/wanghang/p/6299295.html

    總結

    以上是生活随笔為你收集整理的EBS条形码打印的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。