Create Code 128 (b) bar codes in Gupta Report Builder 6.2

General discussion forum about all things Team Developer 6.x
bfanguy
United States of America
Posts: 1
Joined: 02 May 2018, 17:48
Location: Houma, USA

Create Code 128 (b) bar codes in Gupta Report Builder 6.2

Post by bfanguy » 02 May 2018, 18:23

Customer is requiring us to print Code 128 (b) barcodes on our packlist that are generated from a canned software package from Infor (Visual).
We can only modify their reports using Gupta Report Builder 6.2 (we can't modify their software (.exe's))

I found examples of a Function Class someone wrote, but have no idea if and how it can be called within Gupta Report Builder 6.2

Any help is greatly appreciated.

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 )
            

Scott
Australia
Posts: 4
Joined: 13 Mar 2017, 23:31
Location: Sydney, Australia

Re: Create Code 128 (b) bar codes in Gupta Report Builder 6.2

Post by Scott » 02 May 2018, 23:35

You can find fonts available for Code 39 & 128 available for free download. You install & use them like any other font so no coding changes required (other than a possible stop/start character in the RB formula).

H3PO4
Germany
Posts: 30
Joined: 10 Mar 2017, 07:53
Location: Rohlstorf, Germany

Re: Create Code 128 (b) bar codes in Gupta Report Builder 6.2

Post by H3PO4 » 03 May 2018, 10:07

Hi bfanguy,

is the value, you want do display as Code 128 already passed to RB?

Regards
Henning

Didiman
Germany
Posts: 11
Joined: 21 Mar 2017, 13:05
Location: Bremen, Germany

Re: Create Code 128 (b) bar codes in Gupta Report Builder 6.2

Post by Didiman » 07 May 2018, 10:09

Hi,

you can't call a SqlWindows Functional Class from within Report Builder. This is expected to be made in the exe. If you're are using a database that is capable with stored functions ( eg. Oracle), you can try to implement the Check Digits Routine in a stored function and then call it vie a query in Report Builder. Be aware, that you have to convert your barcode data as well before printing this with a barcode font, because the character mappings are a bit difficult to handle.

Greetz

--Andreas

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests