Hi,
I am designing a fixed-width export report in Crystal 8.5.
I have used the formula:
numbervar requiredlength:= 35;
stringvar Address1:=trim({EInfo.address1});
numbervar currentlength:=length(Address1);
If currentlength < requiredlength then
Address1 + replicatestring(' ', requiredlength - currentlength)
else
Address1[1 to requiredlength]
The problem is that this has produced unpredictable results. On some records, it will include an extra space somewhere within the data and on other records, it works as expected. There seems to be no pattern to why it is doing it.
One other thing that I am looking into is that these are all embedded in one large text string and wonder if that could account for the unexpected results.
Any ideas what I can look at would be greatly appreciated.
Thanks,
Darrin
I am designing a fixed-width export report in Crystal 8.5.
I have used the formula:
numbervar requiredlength:= 35;
stringvar Address1:=trim({EInfo.address1});
numbervar currentlength:=length(Address1);
If currentlength < requiredlength then
Address1 + replicatestring(' ', requiredlength - currentlength)
else
Address1[1 to requiredlength]
The problem is that this has produced unpredictable results. On some records, it will include an extra space somewhere within the data and on other records, it works as expected. There seems to be no pattern to why it is doing it.
One other thing that I am looking into is that these are all embedded in one large text string and wonder if that could account for the unexpected results.
Any ideas what I can look at would be greatly appreciated.
Thanks,
Darrin