Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Barcode 39 with checksum

edited February 2009 in General
?Hi All,

i ?ve a question. i want to make a barcode with a checksum. But i see
only a "normal" 39 barcode in the barcode properties.

And a other thing. i want to build 3 datas from the db to one barcode.
e.g.
Var1= xx
Var2= yy
Var3= zz

Barcode: xx/yy/zz

Can someone help me.

Thanks a lot!

Michael



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited February 2009
    Hi Michael,

    For future reference, please use your real name when posting.

    The ReportBuilder barcode component currently only supports the addition of
    a check digit to the UPC-A and EAN13 barcodes. All other check digits will
    need to be added manually using its specific calculation method. This is a
    feature we will consider adding to a later version of ReportBuilder.

    You can use the Band.BeforePrint event to manually assign the Data property
    of a barcode. Something like the following will populate it with three
    separate field values.

    ppBarcode.Data := ppDBPipeline['Field1'] + ppDBPipeline['Field2'] +
    ppDBPipeline['Field3'];

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2009
    Here is some info I found that explains how to calculate the Code 39
    checksum

    http://en.wikipedia.org/wiki/Code_39




    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2009
    Hi Nad,

    thanks for the help. Have you the code also in delphi?

    thanks

    Michael




    --- posted by geoForum on http://delphi.newswhat.com
  • edited February 2009

    const
    // jeu de caratère pour code 39
    CharSet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-._$/+%';

    // Génére le checksum modulo 43 pour le code 39
    function Generateur_cheksum(val: String) :String;
    var
    x,i: Integer;
    s :String;
    begin
    x :=0;
    s :='';

    for i:=1 to StrLen(Pchar(val)) do
    begin
    x := x + (Pos(val[i],CharSet)-1);
    // Calcul du checksum pour code 39 (modulo 43)
    s := CharSet[(x mod 43)+1];
    end;
    Result := val+s;
    end;

    J-Pierre


This discussion has been closed.