How to use the barcode components with ReportBuilder

Usage:

  1. Edit your report, put a TppImage control to your report in order to present the barcode symbol.
  2. Put a barcode component, such as the TBarcode_Code39, TBarcode_EAN13, and TBarcode_Code128 to your form that the TppReport component is in it.

    Also, put a TDBBarcode component to the form and link the TBarcode component to the TDBBarcode 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 TBarcode 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 TBarcode component to draw the barcode symbol to the TppImage control.

    For example:

    Barcode_Code391.Barcode := '1235678';

    Barcode_Code391.Module := 2;

    ......

    ppReport1Image1.Picture.Bitmap.Width := Barcode_Code391.DefaultDisplayWidth(1);

    ppReport1Image1.Picture.Bitmap.Height := 100;

    Barcode_Code391.DrawTo(ppReport1Image1.Picture.Bitmap.Canvas, 1, 0, 0, 100, 0, 0, 0);

Contents