How to get a Code-128 Barcode on a Report

Buenas tardes, les consulto, tengo que hacer un reporte y en el mismo tengo que imprimir un código de barras (code-128), alguien me puede ayudar con la lógica que debo hacer en el embebido del clarion, muchas gracias


Google Translate

Good afternoon, I have a question, I have to make a report and in it I have to print a barcode (code-128), can someone help me with the logic that I should do in the Clarion embedding, thank you very much

There are a few threads about barcode on Clarionhub. Try doing a search.

For example, here is one Generate Barcode in Clarion

I did see the thread, but I have no solution in this case for an application developed in Clarion 5b, which for reasons of time I cannot pass it to Clarion 11

Apologies for not clarifying that I am working with Clarion 5B

Did you investigate the link of the suggestion of using the font? Here is the one for Code-128 The code 128

1 Like

Yes, I’m looking into it

As Jeff said. Years ago, I did it in a C6 app only using the font for this

Ok I’m going to try it but I don’t think it works, thanks

Don’t know with the code-128 font, but with the 3of9 font you must use a string content to show/print using with the barcode font and surround it with *
For example,
LOC:StringProductBarcode = '*' & CLIP( PROD:LongProductCode) & '*'

hello, I use the font 3 of 9 but for few characters, now we need the code 128 because it is 59 characters and has better compression, the barcode is shorter and readers can read it

1 Like

The problem with Code128 is that you need an encoder.

Do you know how to implement a CLASS object via a .inc file into Clarion 5 ?

That’s right I need an encoder or the logic to code. Regarding the Class via Inc I did it a while ago

I need to use code-128, for compression it has 59 digits

JSlarve already posed a link to the logic … GrandeZebu encoder

I translated that for my encoder, I will look it out for you (or you can look on the newsgroup, I am sure it is there as well).

Don’t look for it because I already got it, but it doesn’t work, I’m checking the logic

What about to just use the DLL from the Zint generator?

Flavio the problem is that I have developed this application in clarion5b and the zint is from clarion 6.3

The Zint itself is made in C and TCL…
Maybe you can use de Clarion 5’s LibMaker to make a proper lib to use the Zint DLL…

1 Like

Hi !
There are no dependencies on the version of Clarion in the ZINT class.
Paste this simple code into your application.

[After Global Include]  
  Include('zint.inc')

[Local Procedure]
Loc:MyZint  ZintClass
  Code
  ...
  Loc:MyZint.Setting(ZINT_BARCODE_CODE128)
  If Loc:MyZint.WriteToFile('4712780582862') = 0
     Report$?Image{Prop:Text} = Loc:MyZINT.FileName
  end

This is not the most effective solution if you need to create thousands of labels.
It shows how to work with the code through a file.

2 Likes

Ok thank you very much