CODE-128C barcode

Discussions specific to Team Developer 5.1.

CODE-128C barcode

Postby ivano_osti » Sun Aug 16, 2009 7:28 pm

Hi.

I need to print a document that has a CODE-128C barcode.

Do you have a font to use with report builder? If yes, please could you provide to me?

Any tip is welcome.

Thanks for the attention.
Ivano Edilberth Osti
ivano@highperf.com.br
http://www.highperf.com.br/ivano

High Performance de Itapira Informática Ltda.
http://www.highperf.com.br

Itapira-SP Brazil
User avatar
ivano_osti
 
Posts: 381
Joined: Fri Dec 21, 2007 6:03 am
Location: Brazil

Re: CODE-128C barcode

Postby Didiman » Sun Aug 16, 2009 10:36 pm

There are several free Barcode fonts out there. Google may help there. But you to calculate the Barcodedata by yourself, because the content of the Barcode is not what you print to font. And expecially the checkdigit has to be calculated according to the application. For that there are some commercial Active X components available. Even here google will help.
Andreas Neugebauer
Head of IT
AZUL Kaffee GmbH & Co. KG
Bremen / Germany
User avatar
Didiman
 
Posts: 167
Joined: Sat Jan 05, 2008 3:50 am

Re: CODE-128C barcode

Postby ivano_osti » Sun Aug 16, 2009 10:49 pm

Hi Andreas.

I'm trying http://www.freebarcodefonts.dobsonsw.com/

I'm evaluating their DLL to get the text to be sent to the barcode font because as you said, "the content of the Barcode is not what you print to font".

The problem is that I need to implement a project in Sep, 01 and I'm rushing a lot with the job.

Well, I hope to have success today.

If some friend has fonts/sample to get the text, please send me.

Thank you.
Ivano Edilberth Osti
ivano@highperf.com.br
http://www.highperf.com.br/ivano

High Performance de Itapira Informática Ltda.
http://www.highperf.com.br

Itapira-SP Brazil
User avatar
ivano_osti
 
Posts: 381
Joined: Fri Dec 21, 2007 6:03 am
Location: Brazil

Re: CODE-128C barcode

Postby ivano_osti » Mon Aug 17, 2009 7:49 pm

Hi.

I think I got the solution.

Sample attached. (It was not very well tested yet...)

Thank you.
You do not have the required permissions to view the files attached to this post.
Ivano Edilberth Osti
ivano@highperf.com.br
http://www.highperf.com.br/ivano

High Performance de Itapira Informática Ltda.
http://www.highperf.com.br

Itapira-SP Brazil
User avatar
ivano_osti
 
Posts: 381
Joined: Fri Dec 21, 2007 6:03 am
Location: Brazil

Re: CODE-128C barcode

Postby Peyote » Wed Jan 13, 2010 4:31 pm

Hi Ivano,
I've got exactly the same project as yours to develop. Before I start and, maybe waste my time, in writing a function to do that,
did you test the attachment so to let us use that?
Is there something I should know, apart from installing the Code128 font, to make it work right?

Thank you so much in advance for your reply,
Piero

PS: I downloaded it and made a quick test, but my I think the settings of my laptop are wrong because not all the chars in the result are visible
Peyote
 
Posts: 5
Joined: Tue Mar 24, 2009 8:21 pm

Re: CODE-128C barcode

Postby jmcnamara » Thu Jan 14, 2010 6:47 am

From my experience, free-ware/share-ware fonts are only acceptable if you can tolerate a high scan failure rate. Best to bite the bullet and buy rights to a font set from a reputable vendor.

I haven't looked at the specs for a 128 bar code in a long time, but if you only need to add a check digit, I have a TD class that will do that - if you're interested.
jmcnamara
 
Posts: 117
Joined: Thu Dec 13, 2007 9:39 am

Re: CODE-128C barcode

Postby Peyote » Thu Jan 14, 2010 9:03 am

Hi jmcnamara,
that's exactly what i need.. I've got the same class in vb.net, we wrote it years ago and it works fine with the Code128C.
I should write it down in TD, but first I was checking the possibility to download or purchase something tested and working fine (I'm quite in a rush, as usual :D ), could you please tell me about your class?
Don't hesitate to contact me in private or pserale [at] gmail.com if you prefer ;)
Thanks in advance,
Piero
----------------------------------------------
Best regards,
Piero Serale
Peyote
 
Posts: 5
Joined: Tue Mar 24, 2009 8:21 pm

Re: CODE-128C barcode

Postby jmcnamara » Fri Jan 15, 2010 6:50 am

Attached in a notepad file
jmcnamara
 
Posts: 117
Joined: Thu Dec 13, 2007 9:39 am

Re: CODE-128C barcode

Postby jmcnamara » Fri Jan 15, 2010 7:01 am

Hmmm... I don't see the attachment - here's the code:

Functional Class: c_f_CheckDigit
Description: Uses the Luhn algorithm to
(1) add a check digit to a string
(2) tests that a string ending with a check digit is valid
Derived From
Class Variables
Instance Variables
Functions
Function: AddDigit
Description:
Returns
String:
Parameters
String: p_sSource
Static Variables
Local variables
Number: nEnd
Number: nCount
Number: nSum
Number: nValue
String: sChar
Number: nMod
Actions
Set nEnd = SalStrLength( p_sSource ) - 1
While nEnd >= 0
Set nCount = nCount + 1
Set sChar = SalStrMidX( p_sSource, nEnd, 1 )
! Get the ASCII value of the current character
Call SalStrFirstC( sChar, nValue )
! Subtract 48 (ASCII zero)
Set nValue = nValue - 48
If nCount / 2 = SalNumberTruncate( nCount / 2, 5, 0 )
Else
Set nValue = __f( nValue )
Set nSum = nSum + nValue
Set nEnd = nEnd - 1
Set nMod = SalNumberMod( nSum, 10 )
If nMod = 0
Set sChar = '0'
Else
Set sChar = SalNumberToStrX( 10 - nMod, 0 )
! Set sChar = SalStrRightX( SalNumberToStrX( nSum, 0 ), 1 )
! Set sChar = SalNumberToStrX( 10 - SalStrToNumber( sChar ), 0 )
! Set sChar = SalNumberToStrX( SalNumberMod( nSum, 10 ), 0 )
Return p_sSource || sChar
Function: Verify
Description:
Returns
Boolean:
Parameters
String: p_sSource
Static Variables
Local variables
Number: nEnd
Number: nCount
Number: nSum
Number: nValue
String: sChar
Actions
Set nEnd = SalStrLength( p_sSource ) - 1
While nEnd >= 0
Set nCount = nCount + 1
Set sChar = SalStrMidX( p_sSource, nEnd, 1 )
Call SalStrFirstC( sChar, nValue )
Set nValue = nValue - 48
If nCount / 2 = SalNumberTruncate( nCount / 2, 5, 0 )
Set nValue = __f( nValue )
Else
Set nSum = nSum + nValue
Set nEnd = nEnd - 1
Set sChar = SalStrRightX( SalNumberToStrX( nSum, 0 ), 1 )
If sChar = '0'
Return TRUE
Return FALSE
Function: __f
Description:
Returns
Number:
Parameters
Number: p_nIn
Static Variables
Local variables
Actions
Return 2 * p_nIn - 9 * SalNumberTruncate( p_nIn / 5, 5, 0 )
jmcnamara
 
Posts: 117
Joined: Thu Dec 13, 2007 9:39 am

Re: CODE-128C barcode

Postby jmcnamara » Fri Jan 15, 2010 12:22 pm

This might be easier to read:

Code: Select all
Functional Class: c_f_CheckDigit
   Description: Uses the Luhn algorithm to
            (1) add a check digit to a string
            (2) tests that a string ending with a check digit is valid
   Derived From
   Class Variables
   Instance Variables
   Functions
      Function: AddDigit
         Description:
         Returns
            String:
         Parameters
            String: p_sSource
         Static Variables
         Local variables
            Number: nEnd
            Number: nCount
            Number: nSum
            Number: nValue
            String: sChar
            Number: nMod
         Actions
            Set nEnd = SalStrLength( p_sSource ) - 1
            While nEnd >= 0
               Set nCount = nCount + 1
               Set sChar = SalStrMidX( p_sSource, nEnd, 1 )
               ! Get the ASCII value of the current character
               Call SalStrFirstC( sChar, nValue )
               ! Subtract 48 (ASCII zero)
               Set nValue = nValue - 48
               If nCount / 2 = SalNumberTruncate( nCount / 2, 5, 0 )
               Else
                  Set nValue = __f( nValue )
               Set nSum = nSum + nValue
               Set nEnd = nEnd - 1
            Set nMod = SalNumberMod( nSum, 10 )
            If nMod = 0
               Set sChar = '0'
            Else
               Set sChar = SalNumberToStrX( 10 - nMod, 0 )
            ! Set sChar = SalStrRightX( SalNumberToStrX( nSum, 0 ), 1 )
            ! Set sChar = SalNumberToStrX( 10 - SalStrToNumber( sChar ), 0 )
            ! Set sChar = SalNumberToStrX( SalNumberMod( nSum, 10 ), 0 )
            Return p_sSource || sChar
      Function: Verify
         Description:
         Returns
            Boolean:
         Parameters
            String: p_sSource
         Static Variables
         Local variables
            Number: nEnd
            Number: nCount
            Number: nSum
            Number: nValue
            String: sChar
         Actions
            Set nEnd = SalStrLength( p_sSource ) - 1
            While nEnd >= 0
               Set nCount = nCount + 1
               Set sChar = SalStrMidX( p_sSource, nEnd, 1 )
               Call SalStrFirstC( sChar, nValue )
               Set nValue = nValue - 48
               If nCount / 2 = SalNumberTruncate( nCount / 2, 5, 0 )
                  Set nValue = __f( nValue )
               Else
               Set nSum = nSum + nValue
               Set nEnd = nEnd - 1
            Set sChar = SalStrRightX( SalNumberToStrX( nSum, 0 ), 1 )
            If sChar = '0'
               Return TRUE
            Return FALSE
      Function: __f
         Description:
         Returns
            Number:
         Parameters
            Number: p_nIn
         Static Variables
         Local variables
         Actions
            Return 2 * p_nIn - 9 * SalNumberTruncate( p_nIn / 5, 5, 0 )
jmcnamara
 
Posts: 117
Joined: Thu Dec 13, 2007 9:39 am

Re: CODE-128C barcode

Postby Jeff Luther » Fri Jan 15, 2010 12:33 pm

Sure is! Thanks a lot for resubmitting, Jim!

BTW, anyone who wants to know more about the "Luhn algorighm" Jim mentions in his sample, here's a Wikipedia link (in English):
http://en.wikipedia.org/wiki/Luhn_algorithm

Plus there are lots of other links using this search string: Luhn algorithm
Jeff Luther
 

Re: CODE-128C barcode

Postby Peyote » Tue Jan 19, 2010 2:29 pm

Thank you guys, that was helpful!

If anyone is interested in some more free stuff I can suggest this url: http://grandzebu.net/index.php

Thanks again,
----------------------------------------------
Best regards,
Piero Serale
Peyote
 
Posts: 5
Joined: Tue Mar 24, 2009 8:21 pm

Re: CODE-128C barcode

Postby cindy313 » Sun Jun 22, 2014 8:24 pm

i found this site from google
code 128 barcode generator program use vb.net
cindy313
 
Posts: 11
Joined: Thu Dec 19, 2013 12:40 am


Return to Team Developer 5.1

Who is online

Users browsing this forum: No registered users and 1 guest

cron