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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.