Impression of Billet Banch with bar code

Perguntas relacionadas a questões técnicas do Oracle EBS. Criação de Concorrentes, Value Sets, Alerts, Forms Personalizations, Configurações, etc
  

Poston Mon, 01 Mar 2010 11:06 am

Good morning friends, Work with Oracle Applications 11i (Forms and Reports, PLSQL) and am studying to develop the impression of billet Banch for Banco do Brazil in Laser printer, with bar code. Our server is RedHat Linux.
I have many doubts, if anyone can help me.
-You must install a font for the bar code on the server?
What font is this?
-Concurrent registration, which put format? PDF, PCL?
What is style? A4, LandWide?
You have to set something in the parameter DESFORMAT in report?
can someone give me a hint please.
Thank you, Marlon
marlonpasquali
Location: ERECHIM - RS

Poston Thu, 04 Mar 2010 9:28 am

Marlon, good morning. we made a billet implementation that uses the barcode.
We have a jsp (Java Stored Procedure) that generates barcode.
It returns an image where the reports you position according to the layout of the banco do brasil.
Search in glufke by a topic called Boleto Bancário.

Best regards
alexrsilva
Location: Rio de Janeiro - RJ

Alex Silva
Analista de Sistemas
11i.10 Applications Developer Implementation Champion
11i.10 E-Business Suite Integration Champion

Poston Thu, 04 Mar 2010 12:06 pm

Personal.

I need to make a Report of bar code labels, and a friend informed me that must be registered to barcode folder somewhere. ???

With this, it's just drawing the field in the report, and choose the correct font.

Someone already did it?

The source of the codigo de barras and Bcode128.ttf Any tip and validates.

Abs.
madmax
Location: São Paulo

________________________________
Douglas - Madmax.

Poston Thu, 04 Mar 2010 12:32 pm

Sorry Douglas, Register the barcode?
She should have talked about this file [url = ://blogs http . . oracle com/xmlpublisher/files/BarcodePrinting pdf .] Link [/url] or [url = ://download http . . oracle com/docs/cd/E12839_01/./b32122/1111 bi orbr_barcode002 . htm] another link [/url].
Take a look at [url = ://glufke http . net/oracle/viewtopic php? t = 5741 .] here [/url].

Best regards
alexrsilva
Location: Rio de Janeiro - RJ

Alex Silva
Analista de Sistemas
11i.10 Applications Developer Implementation Champion
11i.10 E-Business Suite Integration Champion

Poston Thu, 04 Mar 2010 12:45 pm

Great Alex.

Thanks I'll take a look.

Abs..
madmax
Location: São Paulo

________________________________
Douglas - Madmax.

Poston Thu, 04 Mar 2010 1:52 pm

Alex, it would be very hard you send me example of this report and this Java routine. I have no experience in this type of development and I have many doubts. If it is not causing you any trouble of course .... Anyway thank you for the tips.

Thank you, Marlon email: marlon.pasquali@peccin.com.br
marlonpasquali
Location: ERECHIM - RS

Poston Thu, 04 Mar 2010 3:34 pm

Once you'vê added the [url = ://jbars http . sourceforge net/.] jbars [/url] at oracle, compiles this code
Code: Select all
create or replace and compile java source named barcode as
import java.io.*;
import javax.swing.*;
import org.jbars.*;
import java.awt.image.*;
import java.awt.*;
import oracle.sql.*;
import oracle.jdbc.*;
class Barcode {
   public Barcode() {
      super();
   }
public static BLOB code(String code,String type, String sizeY) throws java.sql.SQLException, Exception{
    OracleConnection conn = (OracleConnection) new OracleDriver().defaultConnection();
    conn.setAutoCommit(false);
    BLOB blob = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
      String imageFormat = Barcode.JPG;
      String quietZone = null;
      // Create Barcode
      Barcode barcode = null;
      if (type.equalsIgnoreCase("CODE128")) {
         barcode = new Barcode128();
      }
      if (type.equalsIgnoreCase("CODE93")) {
         barcode = new Barcode93();
      }
      if (type.equalsIgnoreCase("INTER25")) {
         barcode = new BarcodeInter25();
      }
      if (barcode == null) {
         System.out.println("Unknow barcode type: " + type);
         System.exit(1);
      }
                Color barColorColor;
                        barColorColor = Color.black;
                Color textColorColor;
                        textColorColor = Color.black;
                double angle = 0;
                barcode.setFontSize(10);
      barcode.setTextAlignment(Barcode.ALIGN_CENTER);
      barcode.setCode(code);
         byte[] file=null;
         if(imageFormat.equals(Barcode.PNG)){
            file= barcode.createPNG(Integer.parseInt(sizeY),
               barColorColor, textColorColor, angle);
         }
         else if(imageFormat.equals(Barcode.JPG)){
            file= barcode.createJPG(Integer.parseInt(sizeY),
                  barColorColor, textColorColor, angle);
         }
         else{
            System.out.println("Unknow image format: " + imageFormat);
            System.exit(1);
         }
         //FileOutputStream os = new FileOutputStream(new File(fileName));
                        OutputStream os = blob.getBinaryOutputStream();
         os.write(file);
         os.flush();
         os.close();
           return blob;
   }
}
can call him that
Code: Select all
FUNCTION generate_barcode( p_code IN VARCHAR2  -- Números do código de barras
                                  , p_tipo IN VARCHAR2  --'CODE128','CODE93' ou 'INTER25'
                                                       --passe CODE128
                                  , p_size IN VARCHAR2 -- Tamanho da imagem, eu utilizo 50
         ) RETURN BLOB
AS LANGUAGE JAVA NAME 'Barcode.code(java.lang.String, java.lang.String,java.lang.String ) return oracle.sql.BLOB';
it returns the image of the barcode.
alexrsilva
Location: Rio de Janeiro - RJ

Alex Silva
Analista de Sistemas
11i.10 Applications Developer Implementation Champion
11i.10 E-Business Suite Integration Champion

Poston Fri, 16 Apr 2010 5:23 pm

And how to call the function and include the image in the report (generate_barcode) on reports6i because it is field of type blob?
senger
Location: SC

Poston Mon, 19 Apr 2010 10:18 am

at the time the image was recorded in field of billet table of type blob.
In query reports, search this data.
After puts a field of type binary lob and the source field in your query.

Best regards
alexrsilva
Location: Rio de Janeiro - RJ

Alex Silva
Analista de Sistemas
11i.10 Applications Developer Implementation Champion
11i.10 E-Business Suite Integration Champion

Poston Mon, 19 Apr 2010 11:32 am

Thanks for the reply ...

When I run via SQLplus or reports: ERROR at line 2: ORA-29532: Java call terminated by uncaught Java exception: java.lang.NullPointerException I used the loadjava and stayed that way: org/org/Barcode128/jbars jbars/jbars/org/Barcode Barcode93 and created barcode2.java ... with the code you posted here. That's how it's done? What could be wrong.

Thank you.
senger
Location: SC

Poston Tue, 20 Apr 2010 1:28 pm

Someone managed to implement in oracle 9?
== When will run the lines of the error type:
Code: Select all
setFont(new Font("Helvetica", Font.PLAIN, 20)); 
and
Code: Select all
Graphics2D g = (Graphics2D) image.createGraphics();
the error is the following: ORA-29532: Java
call terminated by uncaught Java exception: Java.lang. NullPointerException
When I commented the line that sets the font for example spent, but later gave error on line ref. to the Graphics2D
senger
Location: SC

Poston Tue, 20 Apr 2010 1:48 pm

I'm doing a tutorial and send to the admin post here.
I have a 10 g database. But there is no difference of 10 to the 9:0 pm compared to java.
alexrsilva
Location: Rio de Janeiro - RJ

Alex Silva
Analista de Sistemas
11i.10 Applications Developer Implementation Champion
11i.10 E-Business Suite Integration Champion

Poston Mon, 19 Sep 2011 4:08 pm

Alex, as I talk to add JBARS libraries in oracle.

To create a procedure to generate the barcode to my billet.

With much effort managed to implement sort over the algorithms for barcode generation (numbering) and line digitável (numbering).

Now you need to generate the barcode image to the billet that I drew on the Reports.

Downloaded the library JBARS just do not know how to add this bank to be able to use.

Could give me some pointers?

att, Ricardo Miranda
rcd_tech@hotmail.com
Location: SP

Poston Tue, 20 Sep 2011 10:36 am

Nobody?
rcd_tech@hotmail.com
Location: SP

Poston Tue, 20 Sep 2011 1:40 pm

searches for loadjava utility that loads the .jar or .class to the Bank.

:D
diegolenhardt
Location: Recife

Poston Tue, 27 Sep 2011 8:04 pm

Good evening, I have doubts in the development of bar code for the banco Itau, I saw on the forum that you implemented using jsp, if possible could you send me and add me on msn to exchange information.


Alex follows my email: vagner.rigo@hotmail.com Hug
vagner.rigo
Location: Assis - SP

Poston Wed, 17 Feb 2016 10:34 am

Guys, I am also in need of developing the billet of banco Itau in report6i.
In fact I already have but I have problems to generate the pdf with the source code 2/5 Interleaved.

Can someone send me these tips?
lucas.bessa@obers.com.br
bessa_lucas

Lucas Bessa
Analista de Sistemas

lucas.bessa@obers.com.br
lucas.bessa.ti@gmail.com

Poston Wed, 11 May 2016 11:38 am

Hello guys, After Alex Silva's help, managed to create a class in java and generate the hex file, from that I transform it into raw to generate it on the screen.

I generated the Hexadecimal in netbeans and ran the other procedures in the Report6i, it's time to turn the last method getHex " " he has the comparison (" and ") that I couldn't still an alternative.

Code: Select all
create or replace and compile java source named GerarBarcode as
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/


import org.jbars.*;
import java.awt.*;
import java.io.*;
import java.sql.Blob;

class GerarBarcode {

    public GerarBarcode() {
        super();
    }
   
    public String code(String codigo, String type, String sizeY,String extensao) throws java.sql.SQLException, Exception {

        Blob blob = null;
        byte[] file = null;

        String imageFormat = "barcode128.JPG";

        if (type.equalsIgnoreCase("CODE128")) {
            Barcode128 barcode128 = new Barcode128();

            Color barColorColor;
            barColorColor = Color.black;
            Color textColorColor;
            textColorColor = Color.black;
            double angle = 0;

            barcode128.setFontSize(10);
            barcode128.setTextAlignment(barcode128.ALIGN_CENTER);
            barcode128.setCode(codigo);

            if (imageFormat.equals("barcode128.PNG")) {
                file = barcode128.createPNG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else if (imageFormat.equals("barcode128.JPG")) {
                file = barcode128.createJPG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else {
                System.out.println("Unknow image format: " + imageFormat);
                System.exit(1);
            }

        }
       
        if (type.equalsIgnoreCase("CODE93")) {
            Barcode93 barcode93 = new Barcode93();

            Color barColorColor;
            barColorColor = Color.black;
            Color textColorColor;
            textColorColor = Color.black;
            double angle = 0;

            barcode93.setFontSize(10);
            barcode93.setTextAlignment(barcode93.ALIGN_CENTER);
            barcode93.setCode(codigo);

            if (imageFormat.equals("barcode93.PNG")) {
                file = barcode93.createPNG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else if (imageFormat.equals("barcode93.JPG")) {
                file = barcode93.createJPG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else {
                System.out.println("Unknow image format: " + imageFormat);
                System.exit(1);
            }

        }
       
        if (type.equalsIgnoreCase("INTER25")) {
            BarcodeInter25 barcode25 = new BarcodeInter25();

            Color barColorColor;
            barColorColor = Color.black;
            Color textColorColor;
            textColorColor = Color.black;
            double angle = 0;

            barcode25.setFontSize(10);
            barcode25.setTextAlignment(barcode25.ALIGN_CENTER);
            barcode25.setCode(codigo);

            if (imageFormat.equals("barcode25.PNG")) {
                file = barcode25.createPNG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else if (imageFormat.equals("barcode25.JPG")) {
                file = barcode25.createJPG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else {
                System.out.println("Unknow image format: " + imageFormat);
                System.exit(1);
            }

        }
               
               
        GerarBarcode conversor = new GerarBarcode();
        String retorno = conversor.getHex(file);

        return retorno;
    }
   
   
    public String getHex(byte[] raw) {
        String HEXES = "0123456789ABCDEF";
        if (raw == null) {
            return null;
        }
        final StringBuilder hex = new StringBuilder(2 * raw.length);
        for (final byte b : raw) {
            hex.append(HEXES.charAt((b & 0xF0) >> 4))
                    .append(HEXES.charAt((b & 0x0F)));
        }
        return hex.toString();
    }

}

bessa_lucas

Lucas Bessa
Analista de Sistemas

lucas.bessa@obers.com.br
lucas.bessa.ti@gmail.com

Poston Fri, 13 May 2016 11:05 am

Personal code update.

I saw that generate in hex for me was not a good choice.

Now throw it in Blob
Code: Select all
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED SYS.GERARBARCODE as import org.jbars.*;
import java.awt.*;
import java.io.*;
import java.sql.Blob;
import oracle.jdbc.*;
import oracle.sql.*;



class GerarBarcode {

    public GerarBarcode() {
        super();
    }
   
    public static Blob code(String codigo, String tipo, String sizeY,String extensao) throws java.sql.SQLException, Exception {
        OracleConnection conn = (OracleConnection) new OracleDriver().defaultConnection();
        conn.setAutoCommit(false);
        BLOB blob = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);

        byte[] file = null;

        String imageFormat = "barcode128.JPG";

        if (tipo.equalsIgnoreCase("CODE128")) {
            Barcode128 barcode128 = new Barcode128();

            Color barColorColor;
            barColorColor = Color.black;
            Color textColorColor;
            textColorColor = Color.black;
            double angle = 0;

            barcode128.setFontSize(10);
            barcode128.setTextAlignment(barcode128.ALIGN_CENTER);
            barcode128.setCode(codigo);

            if (imageFormat.equals("barcode128.PNG")) {
                file = barcode128.createPNG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else if (imageFormat.equals("barcode128.JPG")) {
                file = barcode128.createJPG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else {
                System.out.println("Unknow image format: " + imageFormat);
                System.exit(1);
            }

        }
       
        if (tipo.equalsIgnoreCase("CODE93")) {
            Barcode93 barcode93 = new Barcode93();

            Color barColorColor;
            barColorColor = Color.black;
            Color textColorColor;
            textColorColor = Color.black;
            double angle = 0;

            barcode93.setFontSize(10);
            barcode93.setTextAlignment(barcode93.ALIGN_CENTER);
            barcode93.setCode(codigo);

            if (imageFormat.equals("barcode93.PNG")) {
                file = barcode93.createPNG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else if (imageFormat.equals("barcode93.JPG")) {
                file = barcode93.createJPG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else {
                System.out.println("Unknow image format: " + imageFormat);
                System.exit(1);
            }

        }
       
        if (tipo.equalsIgnoreCase("INTER25")) {
            BarcodeInter25 barcode25 = new BarcodeInter25();

            Color barColorColor;
            barColorColor = Color.black;
            Color textColorColor;
            textColorColor = Color.black;
            double angle = 0;

            barcode25.setFontSize(10);
            barcode25.setTextAlignment(barcode25.ALIGN_CENTER);
            barcode25.setCode(codigo);

            if (imageFormat.equals("barcode25.PNG")) {
                file = barcode25.createPNG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else if (imageFormat.equals("barcode25.JPG")) {
                file = barcode25.createJPG(Integer.parseInt(sizeY),
                        barColorColor, textColorColor, angle);
            } else {
                System.out.println("Unknow image format: " + imageFormat);
                System.exit(1);
            }

        }

         OutputStream os = blob.getBinaryOutputStream();
         os.write(file);
         os.flush();
         os.close();

         return blob;

    }

}
and to call using the function
Code: Select all
create or replace FUNCTION generate_barcode( codigo IN VARCHAR2  -- Números do código de barras
                                  , tipo IN VARCHAR2  --'CODE128','CODE93' ou 'INTER25'
                                  , tamanho IN VARCHAR2 -- Tamanho da imagem, eu utilizo 50
                                  , extensao IN VARCHAR2 -- 'barcode.JPG' ou 'barcode.PNG'
                                    ) RETURN BLOB
AS LANGUAGE JAVA NAME 'GerarBarcode.code(java.lang.String,java.lang.String, java.lang.String,java.lang.String)return oracle.sql.BLOB';
I ran everything in SYS, I have a problem of permission, but it works! :D

Note: Remember to import the library jai_codec and JBARS any questions I am available
bessa_lucas

Lucas Bessa
Analista de Sistemas

lucas.bessa@obers.com.br
lucas.bessa.ti@gmail.com

Poston Wed, 27 Dec 2017 11:13 am

Topic under translation. Come back later. (This is an automatic message)
Porva
Location: São Paulo/SP

Rafael S. Nunes
São Paulo/SP


Next

Return to EBS Technical

Who is online

Users browsing this forum: No registered users and 1 guest