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 7:43PM
    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