How to use the barcode components with a database
Use the classic data access components such as BDE, dbExpress, FireDAC, AnyDAC, etc.
  1. Put a TBarcode2D barcode component, such as the TBarcode2D_QRCode, TBarcode2D_PDF417, and TBarcode2D_RSS14 to your form.

  2. Put a TDBBarcode2D component to your form.

  3. Set the Barcode2D property of the TDBBarcode2D component to your TBarcode2D barcode component.

  4. Set the DataSource property of the TDBBarcode2D component to your TDataSource component.

  5. Set the DataField property of the TDBBarcode2D component to a field in your dataset.

  6. If you use the Delphi/C++ Builder 2009 or later, Set the BindProperty property of the TDBBarcode2D component to indicate which property of the TBarcode2D component the data field value will be applied to.

  7. If you want to represent the barcode symbol in form or QuickReport report, put a TImage control to your form, or put a TQRImage or TQRGzImage control to your report. Set the Image property of the TBarcode2D barcode component to the TImage, TQRImage, or TQRGzImage control. The data in the data field will be represented as a barcode symbol in your TImage, TQRImage, or TQRGzImage control.

  8. If you want to save the barcode symbol to a picture, put a TSave2D component, such as the TSave2D_Bmp, TSave2D_Png, and TSave2D_Svg to your form. Set the Barcode2D property of the TSave2D component to your TBarcode2D barcode component. Then you can use the Save method of the TSave2D component to save the barcode symbol to a picture file.

  9. Also, you can use the Print method of the TBarcode2D component to print the barcode symbol to paper, or use the DrawTo method of the TBarcode2D component to draw the barcode symbol to any TCanvas.

Note, You can bind multiple TDBBarcode2D and TBarcode2D component pairs to a data field in order to represent the data field with multiple barcode symbols.

Use the LiveBindings (Delphi/C++ Builder XE2 or later).
  1. Put a TBarcode2D barcode component, such as the TBarcode2D_QRCode, TBarcode2D_PDF417, and TBarcode2D_RSS14 to your form.

  2. Open the "LiveBindings Designer", click on the barcode component in the form to select it, change the "Visible Element" sub-item of the "LiveBindings Designer" item to true in the "Object Inspector".

  3. Right-click on the barcode component in the "LiveBindings Designer", execute the "Bindable Members..." menu item, check the "Barcode" property or the "Data" property (only for the Delphi/C++ Builder 2009 or later) in the "Bindable Members" dialog, click on the "OK" button to close it.

  4. Link the Barcode property or the Data property (only for the Delphi/C++ Builder 2009 or later) of the TBarcode2D barcode component to your data field in the TBindSourceDB component, or a string property of other control.

  5. If you want to represent the barcode symbol in form or QuickReport report, put a TImage control to your form, or put a TQRImage or TQRGzImage control to your report. Set the Image property of the TBarcode2D barcode component to the TImage, TQRImage, or TQRGzImage control. The data in the data field will be represented as a barcode symbol in your TImage, TQRImage, or TQRGzImage control.

  6. If you want to save the barcode symbol to a picture, put a TSave2D component, such as the TSave2D_Bmp, TSave2D_Png, and TSave2D_Svg to your form. Set the Barcode2D property of the TSave2D component to your barcode component. Then you can use the Save method of the TSave2D component to save the barcode symbol to a picture file.

  7. Also, you can use the Print method of the TBarcode2D component to print the barcode symbol to paper, or use the DrawTo method of the TBarcode2D component to draw the barcode symbol to any TCanvas.

Note, You can link multiple TBarcode2D components to a data field in order to represent the data field with multiple barcode symbols.

Contents