If you are using QR Dos what you will need to do to maintain the leading zeroes in an amount field is to convert it to a string field, and insert the required zeroes as characters in front of the amount.

For the fields you want to zero fill, you will need to use a formula similar to this:

(?000000000000? + ToText (Amount * 100, 0)) [count (?000000000000? +
ToText (Amount * 100, 0)) - 12 to count (?000000000000? + ToText (Amount * 100, 0))]

Please note, in this formula, the number of zeros (?000000000000?) and the amount subtracted (-12) correspond to the number of characters in the field - 1. You will have a problem with negative numbers. Use a formula to make them positive.

For QRW here is an example of a formula to convert an amount field to text with no commas or decimals, useful for exporting to a file that will be imported into a different system. If you want to have leading blanks instead of zeroes, you simply replace the zeroes below when necessary with blanks.

StringVar OutputVal;
OutputVal := ToText({AR61A Customer Information.Balance outstanding},2);
if {AR61A Customer Information.Balance outstanding} < 0 then
OutputVal := OutputVal[2 to Length(OutputVal)]+"-" else OutputVal :=
OutputVal + " ";
OutputVal := OutputVal[2 to Length(OutputVal)];
OutputVal := "0000000000000000000000000" + OutputVal;
OutputVal := OutputVal[Length(OutputVal)-25 to Length(OutputVal)];
//"12,456,890,234,678,012.45-"
OutputVal := OutputVal[1 to 2] + OutputVal[4 to 6] + OutputVal[8 to
10] + OutputVal[12 to 14] + OutputVal[16 to 18] +OutputVal[20 to
Length(OutputVal)];
OutputVal