# How to get a Code-128 Barcode on a Report

**URL:** <https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693>\
**Category:** questions\
**Tags:** report\
**Created:** [November 26, 2024, 6:22pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693 "2024-11-26T18:22:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 26, 2024, 6:22pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/1 "2024-11-26T18:22:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [November 26, 2024, 7:40pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/2 "2024-11-26T19:40:52Z")

</div>

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

For example, here is one [Generate Barcode in Clarion](https://clarionhub.com/t/generate-barcode-in-clarion/7057)

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 26, 2024, 8:28pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/3 "2024-11-26T20:28:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 26, 2024, 8:31pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/4 "2024-11-26T20:31:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [November 26, 2024, 8:44pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/5 "2024-11-26T20:44:18Z")

</div>

Did you investigate the link of the suggestion of using the font? Here is the one for Code-128 [https://grandzebu.net/informatique/codbar-en/code128.htm](https://grandzebu.net/informatique/codbar-en/code128.htm)

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 27, 2024, 12:40pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/6 "2024-11-27T12:40:07Z")

</div>

Yes, I’m looking into it

---

<div class="post-metadata">

**Author:** ![Joei](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/d78d45/32.png) [@Joei](https://clarionhub.com/u/Joei)\
**Post date:** [November 27, 2024, 12:51pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/7 "2024-11-27T12:51:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 27, 2024, 6:25pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/8 "2024-11-27T18:25:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Flavio\_Suarez](https://clarionhub.com/user_avatar/clarionhub.com/flavio_suarez/32/1347_2.png) [@Flavio\_Suarez](https://clarionhub.com/u/Flavio_Suarez)\
**Post date:** [November 28, 2024, 11:05am UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/9 "2024-11-28T11:05:41Z")

</div>

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) & '*'`

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 28, 2024, 12:05pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/10 "2024-11-28T12:05:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Julian](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@Julian](https://clarionhub.com/u/Julian)\
**Post date:** [November 28, 2024, 5:26pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/11 "2024-11-28T17:26:17Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 29, 2024, 11:52am UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/12 "2024-11-29T11:52:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 29, 2024, 11:56am UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/13 "2024-11-29T11:56:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Julian](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@Julian](https://clarionhub.com/u/Julian)\
**Post date:** [November 29, 2024, 12:31pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/14 "2024-11-29T12:31:47Z")

</div>

JSlarve already posed a link to the logic .. [GrandeZebu encoder](https://grandzebu.net/informatique/codbar-en/code128.htm)

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).

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 29, 2024, 12:51pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/15 "2024-11-29T12:51:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Flavio\_Suarez](https://clarionhub.com/user_avatar/clarionhub.com/flavio_suarez/32/1347_2.png) [@Flavio\_Suarez](https://clarionhub.com/u/Flavio_Suarez)\
**Post date:** [November 29, 2024, 2:33pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/16 "2024-11-29T14:33:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 29, 2024, 2:49pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/17 "2024-11-29T14:49:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Flavio\_Suarez](https://clarionhub.com/user_avatar/clarionhub.com/flavio_suarez/32/1347_2.png) [@Flavio\_Suarez](https://clarionhub.com/u/Flavio_Suarez)\
**Post date:** [November 29, 2024, 3:10pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/18 "2024-11-29T15:10:57Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Genricke](https://clarionhub.com/user_avatar/clarionhub.com/genricke/32/5271_2.png) [@Genricke](https://clarionhub.com/u/Genricke)\
**Post date:** [November 29, 2024, 4:14pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/20 "2024-11-29T16:14:09Z")

</div>

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

```auto
[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.

---

<div class="post-metadata">

**Author:** ![EKirigin](https://clarionhub.com/letter_avatar_proxy/v4/letter/e/13edae/32.png) [@EKirigin](https://clarionhub.com/u/EKirigin)\
**Post date:** [November 29, 2024, 5:17pm UTC](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693/21 "2024-11-29T17:17:16Z")

</div>

Ok thank you very much

[Next page](https://clarionhub.com/t/how-to-get-a-code-128-barcode-on-a-report/7693.md?page=2)
