Barcode Type

Hello,
how can I create a expression in Fast Report that controls the length of the field Barcode.
If length of Barcode is 8 set the property of BarcodeObject to EAN 8, else to EAN13.

Thank you in advanced.

Best regards,

Riccardo

Comments

  • edited February 2012
    riccardo wrote: »
    Hello,
    how can I create a expression in Fast Report that controls the length of the field Barcode.
    If length of Barcode is 8 set the property of BarcodeObject to EAN 8, else to EAN13.

    Thank you in advanced.

    Best regards,

    Riccardo

    in onAfterPrint event:
    var
           Bar : String;
           CD : Integer;                                     
    begin
      try                 
           Bar := <frxDBDataset1."BARCODE_DATA">;
           CD := Length(Barra);                          
      except
           // nothing                         
      end;            
      if CD > 12 then
      begin
           BarCode1.BarType:= bcCodeEAN13;                                                                                
      end else
           BarCode1.BarType:= bcCodeEAN8;
    



    Andr?© Rosa @ Brazil.

Leave a Comment