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 TBarcode1D barcode component, such as the TBarcode1D_Code39, TBarcode1D_EAN13, and TBarcode1D_Code128 to your form.

  2. Put a TDBBarcode1D component to your form.

  3. Set the Barcode1D property of the TDBBarcode1D component to your TBarcode1D barcode component.

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

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

  6. If you use the Delphi/C++ Builder 2009 or later, Set the BindProperty property of the TDBBarcode1D component to indicate which property of the TBarcode1D 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 TBarcode1D 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. You can use the Print method of the TBarcode1D component to print the barcode symbol to paper, or use the DrawTo method of the TBarcode1D component to draw the barcode symbol to any TCanvas.

  9. Also, you can use the SaveToFile method of the TImage control that is linked to the TBarcode1D barcode component to save the barcode symbol as a picture file.

Note, You can bind multiple TDBBarcode1D and TBarcode1D 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 TBarcode1D barcode component, such as the TBarcode1D_Code39, TBarcode1D_EAN13, and TBarcode1D_Code128 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.

    Note, for the TBarcode1D_FIM component, please check the "FIMType" or the "Data" (only for the Delphi/C++ Builder 2009 or later) property. For the TBarcode1D_Patch component, please check the "PatchType" or the "Data" (only for the Delphi/C++ Builder 2009 or later) property. For the TBarcode1D_OneCode component, please check the "Tracking" and "Routing" properties or the "Data" property (only for the Delphi/C++ Builder 2009 or later).

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

    Note, for the TBarcode1D_FIM component, please link the FIMType or the Data (only for the Delphi/C++ Builder 2009 or later) property. For the TBarcode1D_Patch component, please link the PatchType or the Data (only for the Delphi/C++ Builder 2009 or later) property. For the TBarcode1D_OneCode component, please link the Tracking and Routing properties or the Data property (only for the Delphi/C++ Builder 2009 or later).

  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 TBarcode1D 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. You can use the Print method of the TBarcode1D component to print the barcode symbol to paper, or use the DrawTo method of the TBarcode1D component to draw the barcode symbol to any TCanvas.

  7. Also, you can use the SaveToFile method of the TImage control that is linked to the TBarcode1D barcode component to save the barcode symbol as a picture file.

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

Contents