5 Replies Latest reply on Jan 21, 2019 6:59 AM by Benny Gong-Oracle

    Custom Printer Driver using system shell script does not work properly

    Benny Gong-Oracle

      An Oracle report concurrent request need to print files with Thai & English characters. The character set for database is al32utf8. But the printer only support ASCII, TIS character encoding. We try to change the setting of printer driver to convert the output file from al32utf8 to th8tisascii. After changing the value of Argument to a shell script, the printer still cannot output the Thai characters correctly, and the script seems not be used during the printing.

       

      The shell sciprt is located in $FND_TOP/$APPLBIN,and the authority is fine.

      The comments in script are below:

      https://orioniss.us.oracle.com/iss/adf/images/t.gif

      #!/bin/bash

       

      #orig_file=$1;

      #new_file=${orig_file}.thai;

      export PATH=/u01/CRP3/fs_ne/EBSapps/appl/ad/bin:/u01/CRP3/fs1/FMW_Home/modules/org.apache.ant_1.7.1/bin:/u01/CRP3/fs1/inst/apps/CRP3_ttcappdev/admin/scripts:/u01/CRP3/fs1/FMW_Home/webtier/perl/bin:/u01/CRP3/fs1/EBSapps/10.1.2/bin:/u01/CRP3/fs1/EBSapps/appl/fnd/12.0.0/bin:/u01/CRP3/fs1/EBSapps/appl/ad/12.0.0/bin:/u01/CRP3/fs1/EBSapps/comn/util/jdk32/jre/bin:/u01/CRP3/fs1/EBSapps/comn/util/jdk32/bin::/u01/CRP3/fs1/EBSapps/10.1.2/OPatch:/u01/CRP3/fs1/EBSapps/10.1.2/bin:/usr/bin:/usr/sbin:/u01/CRP3/fs1/EBSapps/comn/util/jdk32/jre/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/applcrp3/.local/bin:/home/applcrp3/bin

       

       

      echo $1 >> lpth.log 2>&1;

      echo $2 >> lpth.log 2>&1;

      echo $3 >> lpth.log 2>&1;

      echo `date` >> lpth.log 2>&1;

       

      cp ${orig_file} ${new_file} 2>>lpth.log;

       

      lpr -P $1 -# $2 $3 2>>lpth.log;

      echo "----------------------------------" >> lpth.log 2>&1;

       

      Even modify the script to this:

      #!/bin/bash

      echo "This is a test" >> lpth.log 2>&1;

       

      Still no test append in lpth.log.

       

      Can somebody know how to trace this kind of issue?

        • 1. Re: Custom Printer Driver using system shell script does not work properly
          John_K

          Can you post a screenshot of your driver setup?

          • 3. Re: Custom Printer Driver using system shell script does not work properly
            Benny Gong-Oracle

            ################################################################################################################################

            SQL> SELECT NUMBER_OF_COPIES ,NLS_LANGUAGE ,NLS_TERRITORY ,PRINTER , 

              2  PRINT_STYLE ,COMPLETION_TEXT ,OUTPUT_FILE_TYPE , 

              3  NLS_CODESET ,OUTFILE_NODE_NAME,OUTFILE_NAME 

              4  FROM apps.FND_CONCURRENT_REQUESTS 

              5  WHERE REQUEST_ID= &REQID; 

            Enter value for reqid: 53283715

            old   5: WHERE REQUEST_ID= &REQID

            new   5: WHERE REQUEST_ID= 53283715

             

            NUMBER_OF_COPIES NLS_LANGUAGE    NLS_TERRITORY   PRINTER    PRINT_STYLE    COMPLETION_TEXT      OUTP NLS_CODESET  OUTFILE_NODE_NAME

            ---------------- --------------- --------------- ---------- -------------- -------------------- ---- ------------ --------------------

            OUTFILE_NAME

            ------------------------------------------------------------------------------------------

                           1 AMERICAN        AMERICA         TTCPRD02   TTC_15CPI_66   Normal completion    TEXT AL32UTF8     IERPTAU

            /ierptauapp/appprd/inst/apps/IERPTAU_ierptau/logs/appl/conc/out/o53283715.out

             

             

            ################################################################################################################################

            SQL> SELECT PRINTER_STYLE_NAME ,SRW_DRIVER ,WIDTH , LENGTH , 

              2  ORIENTATION FROM apps.FND_PRINTER_STYLES 

              3  WHERE PRINTER_STYLE_NAME= ( SELECT PRINT_STYLE FROM apps.FND_CONCURRENT_REQUESTS WHERE REQUEST_ID= &REQID ); 

            Enter value for reqid: 53283715

            old   3: WHERE PRINTER_STYLE_NAME= ( SELECT PRINT_STYLE FROM apps.FND_CONCURRENT_REQUESTS WHERE REQUEST_ID= &REQID )

            new   3: WHERE PRINTER_STYLE_NAME= ( SELECT PRINT_STYLE FROM apps.FND_CONCURRENT_REQUESTS WHERE REQUEST_ID= 53283715 )

             

            PRINTER_STYLE_NAME             SRW_DRIVER                WIDTH     LENGTH ORIENTATIO

            ------------------------------ -------------------- ---------- ---------- ----------

            TTC_15CPI_66                   TTC_W66.prt                 300         66

             

            ################################################################################################################################

            SQL> SELECT PRINTER_DRIVER_NAME,

              2         USER_PRINTER_DRIVER_NAME,

              3         PRINTER_DRIVER_METHOD_CODE,

              4         SPOOL_FLAG,

              5         SRW_DRIVER,

              6         COMMAND_NAME,

              7         ARGUMENTS,

              8         INITIALIZATION,

              9         RESET

            10    FROM APPS.FND_PRINTER_DRIVERS

            11   WHERE PRINTER_DRIVER_NAME =

            12         (SELECT PRINTER_DRIVER

            13            FROM APPS.FND_PRINTER_INFORMATION

            14           WHERE PRINTER_STYLE =

            15                 (SELECT PRINT_STYLE

            16                    FROM APPS.FND_CONCURRENT_REQUESTS

            17                   WHERE REQUEST_ID = &REQID

            18                     AND PRINTER_TYPE =

            19                         (SELECT PRINTER_TYPE

            20                            FROM APPS.FND_PRINTER

            21                           WHERE PRINTER_NAME =

            22                                 (SELECT PRINTER

            23                                    FROM APPS.FND_CONCURRENT_REQUESTS

            24                                   WHERE REQUEST_ID = &REQID))));

            Enter value for reqid: 53283715

            old  17:                  WHERE REQUEST_ID = &REQID

            new  17:                  WHERE REQUEST_ID = 53283715

            Enter value for reqid: 53283715

            old  24:                                  WHERE REQUEST_ID = &REQID))))

            new  24:                                  WHERE REQUEST_ID = 53283715))))

             

            PRINTER_DRIVER_NAME USER_PRINTER_DRIVER_ PRINTER_DR SPOOL_FLAG SRW_DRIVER           COMMAND_NA ARGUMENTS                                                          INITIALIZATION               RESET

            ------------------- -------------------- ---------- ---------- -------------------- ---------- ------------------------------------------------------------------ ---------------------------- --------

            TTC_15CPI_66        TTC 15 CPI x 66 rows C          Y          TTC_W66.prt                     lpth $PROFILES$.PRINTER $PROFILES$.CONC_COPIES $PROFILES$.FILENAME \033\062\033\103\102\033\147 \033\100

            • 4. Re: Custom Printer Driver using system shell script does not work properly
              Benny Gong-Oracle

              issue caused by default log file path is not also $FND_TOP/$APPLBIN,but $APPLCSF/$APPLLOG

              Give a full path to log file in shell script and it woks as expected.

              • 5. Re: Custom Printer Driver using system shell script does not work properly
                Benny Gong-Oracle

                issue caused by default log file path is not also $FND_TOP/$APPLBIN,but $APPLCSF/$APPLLOG

                Give a full path to log file in shell script and it woks as expected.