Generate Barcode String where Int-Field has leading 0s

Hi there,

I have following topic:

I want to generate a barcode in FastReport which consists of different field values.

In my Barcode Formula I have 1 field where the field "quantity" has an integer value, e.g. 20.
In the Barcode the value 20 must consist of 5 digits, e.g. 00020, the quantity 100 must be 00100, the quantity 1000 must be 01000 and so on....!

In my database I only have the correct quantity value, eg. 20, 100, 1000

How can I generate a barcode formula where the field quantity has leading zeros??

Now I use following code:

Memo2.Text + '0' + <ExportLiefPos."POSITIONSNUMMER"> + IntToStr(<ExportLiefPos."QUANTITY">) which results in following code:

843445800001020 where 20 is the quantity.

I must have the following result:

843445800001000020 where 00020 is the quantity.

I hope I described my problem so that u can understand.

Regards

Thomas

Comments

  • LurkingKiwiLurkingKiwi Wellington, New Zealand
    edited 6:11AM
    You should use
    Format('%5.5d', [<ExportLiefPos."QUANTITY">])
    - this requires that the ExpressionDelimiters property for the memo is set to
    <,>
    else the Format function parameters aren't parsed correctly and the expression text is inserted

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.