How to use the barcode components with ReportBuilder
  1. Edit your report, put a TppImage control to your report in order to present the barcode symbol.
  2. Put a TBarcode1D barcode component, such as the TBarcode1D_Code39, TBarcode1D_EAN13, and TBarcode1D_Code128 to your form that the TppReport component is in it.

    Also, put a TDBBarcode1D component to the form and link the TBarcode1D component to the TDBBarcode1D component if the database support is required.

  3. Create the OnBeforePrint event function for the TppReport component.

    In the event function, change the properties of the TBarcode1D component such as Barcode, Module, and Ratio, and adjust the bitmap size of the TppImage control in order to accommodate entire barcode symbol, then use the DrawTo method of the TBarcode1D component to draw the barcode symbol to the TppImage control.

    For example:


    BarcodeWidth, BarcodeHeight, SymbolWidth, SymbolHeight: Integer;



    Barcode1D_Code391.Barcode := '1235678';

    Barcode1D_Code391.Module := 2;


    with ppReport1Image1.Picture.Bitmap do


    Barcode1D_Code391.DrawToSize(BarcodeWidth, BarcodeHeight, SymbolWidth, SymbolHeight, Canvas);

    Width := BarcodeWidth;

    Height := 100;

    Barcode1D_Code391.DrawTo(Canvas, 0, 0);