I am currently working on an ASCII type report. The field I am working with is the city field. The report requires this field to be 20 characters in length, but some of the city names are 21-25 characters in length. I have tried using the following formula,
if IsNull ({usrCity.Desc1}) then "____________________" else
if length ({usrCity.Desc1}) = 1 then
Picture ({usrCity.Desc1},"x___________________" ) else
if length ({usrCity.Desc1}) = 2 then
Picture ({usrCity.Desc1},"xx__________________" ) else
if length ({usrCity.Desc1}) = 3 then
Picture ({usrCity.Desc1},"xxx_________________" ) else
if length ({usrCity.Desc1}) = 4 then
Picture ({usrCity.Desc1},"xxxx________________" ) else
if length ({usrCity.Desc1}) = 5 then
Picture ({usrCity.Desc1},"xxxxx_______________" ) else
if length ({usrCity.Desc1}) = 6 then
Picture ({usrCity.Desc1},"xxxxxx______________" ) else
if length ({usrCity.Desc1}) = 7 then
Picture ({usrCity.Desc1},"xxxxxxx_____________" ) else
if length ({usrCity.Desc1}) = 8 then
Picture ({usrCity.Desc1},"xxxxxxxx____________" ) else
if length ({usrCity.Desc1}) = 9 then
Picture ({usrCity.Desc1},"xxxxxxxxx___________" ) else
if length ({usrCity.Desc1}) = 10 then
Picture ({usrCity.Desc1},"xxxxxxxxxx__________" ) else
if length ({usrCity.Desc1}) = 11 then
Picture ({usrCity.Desc1},"xxxxxxxxxxx_________" ) else
if length ({usrCity.Desc1}) = 12 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxx________" ) else
if length ({usrCity.Desc1}) = 13 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxx_______" ) else
if length ({usrCity.Desc1}) = 14 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxx______" ) else
if length ({usrCity.Desc1}) = 15 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxx_____" ) else
if length ({usrCity.Desc1}) = 16 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxx____" ) else
if length ({usrCity.Desc1}) = 17 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxxx___" ) else
if length ({usrCity.Desc1}) = 18 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxxxx__" ) else
if length ({usrCity.Desc1}) = 19 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxxxxx_" ) else
if length ({usrCity.Desc1}) = 20 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxxxxxx" ) else ""
I have tried using the same pattern as above and putting the length equal to 21 but keeping the picture funtion to 20 spaces but this does not seem to work. The field continues to keep its original length which is to long.
Any assistance would be great, thanks,
if IsNull ({usrCity.Desc1}) then "____________________" else
if length ({usrCity.Desc1}) = 1 then
Picture ({usrCity.Desc1},"x___________________" ) else
if length ({usrCity.Desc1}) = 2 then
Picture ({usrCity.Desc1},"xx__________________" ) else
if length ({usrCity.Desc1}) = 3 then
Picture ({usrCity.Desc1},"xxx_________________" ) else
if length ({usrCity.Desc1}) = 4 then
Picture ({usrCity.Desc1},"xxxx________________" ) else
if length ({usrCity.Desc1}) = 5 then
Picture ({usrCity.Desc1},"xxxxx_______________" ) else
if length ({usrCity.Desc1}) = 6 then
Picture ({usrCity.Desc1},"xxxxxx______________" ) else
if length ({usrCity.Desc1}) = 7 then
Picture ({usrCity.Desc1},"xxxxxxx_____________" ) else
if length ({usrCity.Desc1}) = 8 then
Picture ({usrCity.Desc1},"xxxxxxxx____________" ) else
if length ({usrCity.Desc1}) = 9 then
Picture ({usrCity.Desc1},"xxxxxxxxx___________" ) else
if length ({usrCity.Desc1}) = 10 then
Picture ({usrCity.Desc1},"xxxxxxxxxx__________" ) else
if length ({usrCity.Desc1}) = 11 then
Picture ({usrCity.Desc1},"xxxxxxxxxxx_________" ) else
if length ({usrCity.Desc1}) = 12 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxx________" ) else
if length ({usrCity.Desc1}) = 13 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxx_______" ) else
if length ({usrCity.Desc1}) = 14 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxx______" ) else
if length ({usrCity.Desc1}) = 15 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxx_____" ) else
if length ({usrCity.Desc1}) = 16 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxx____" ) else
if length ({usrCity.Desc1}) = 17 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxxx___" ) else
if length ({usrCity.Desc1}) = 18 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxxxx__" ) else
if length ({usrCity.Desc1}) = 19 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxxxxx_" ) else
if length ({usrCity.Desc1}) = 20 then
Picture ({usrCity.Desc1},"xxxxxxxxxxxxxxxxxxxx" ) else ""
I have tried using the same pattern as above and putting the length equal to 21 but keeping the picture funtion to 20 spaces but this does not seem to work. The field continues to keep its original length which is to long.
Any assistance would be great, thanks,