Print a QR code or barcode
Print a barcode for each item and a QR code for the whole document. The example uses the Invoice document type.
Before you begin
- Open the designer from a saved invoice, on a template you may change. See Design an advanced report.
- Know the data the code will hold. In the field list,
Material_Barcodeof the "Bill Items" table is the first barcode of the material of each item, andNumberof the "Bill" table is the invoice number (the "Bill Items" table has aNumbertoo, the number of the line). - The code is made from the text of the control, so the scanner reads that text back. The invoice data has no ready field with QR content: build the text in the expression.
Steps
A barcode for each item
- Add a barcode control to the Detail band, in a cell or beside the item name.
- In the Expressions tab of the Properties panel, set Text to
[Material_Barcode]. - On the Barcode Tools tab, open the Symbology group and choose the type that your labels and scanners use, such as Code 128.
- Use Show Text to print the number under the bars, and Auto Module to let the bar width follow the size of the control.
A QR code for the invoice
-
Add another barcode control to the Report Footer or Page Footer band.
-
Set Text to the content you need. For example
[Number], orConcat('INV-', [Number])to add a prefix. -
In the Symbology group, choose QR Code. Make the control square.
-
Click the Preview tab, then click Save.
Result
Each item line prints the barcode of its material, and the footer prints a QR code that holds the invoice number, for example 5. Scan the printed page with a phone to check that the text is the one you expect. Nothing changes in accounts or stock.
If something goes wrong
| Situation | Why it happens | What to do |
|---|---|---|
| The code does not print or is empty. | The material has no barcode, or the field is empty. | Fill the barcode on the material card, or use the material code instead. |
| The symbology refuses the text. | Some types accept only digits or a fixed length. | Choose a type that accepts the text, such as Code 128. |
| The scanner does not read the code. | The control is too small, or the bars are too thin. | Enlarge the control and turn on Auto Module. |
Related
This page applies to alameen ERP 10, version 10.1.79.764.