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 barcode component, such as the TBarcode2D_QRCode, TBarcode2D_PDF417, and TBarcode2D_RSS14 to your form that the TppReport component is in it.

    Also, put a TDBBarcode2D component to the form and link the TBarcode2D component to the TDBBarcode2D 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 TBarcode2D component such as Barcode, Module, and Orientation, and adjust the bitmap size of the TppImage control in order to accommodate entire barcode symbol, then use the DrawTo method of the TBarcode2D component to draw the barcode symbol to the TppImage control.

    For example:


    AWidth, AHeight, ASymbolWidth, ASymbolHeight: Integer;


    Barcode2D_QRCode1.Barcode := '1235678';

    Barcode2D_QRCode1.Module := 1;


    Barcode2D_QRCode1.DrawToSize(AWidth, AHeight, ASymbolWidth, ASymbolHeight);

    ppReport1Image1.Picture.Bitmap.Width := AWidth;

    ppReport1Image1.Picture.Bitmap.Height := AHeight;

    Barcode2D_QRCode1.DrawTo(ppReport1Image1.Picture.Bitmap.Canvas, 0, 0);