Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing spaces in Crystal report custom field

Status
Not open for further replies.

auntdolo

MIS
Mar 12, 2014
5
US
Hi,

I am hitting my head against the wall trying to figure out why the following code is resulting in 67 spaces instead of 40.

Any help would be greatly appreciated.

Thanks,
Dolores

Dim CityStZip As String


if {XDDDepositor.WBeneUseVendorRemit} = 1 then
CityStZip = Trim({Vendor.RemitCity})
if CityStZip <> "" then
CityStZip = CityStZip + ", "
end if
CityStZip = CityStZip + trim({Vendor.RemitState})
CityStZip = CityStZip + " " + trim({Vendor.RemitZip})
CityStZip = left(trim(CityStZip) + Space( 40), 40)
else
CityStZip = Trim({XDDDepositor.WBeneCity})
if CityStZip <> "" then
CityStZip = CityStZip + ", "
end if
CityStZip = CityStZip + trim({XDDDepositor.WBeneState})
CityStZip = CityStZip + " " + trim({XDDDepositor.WBeneZipPostal})
CityStZip = left(trim(CityStZip) + Space( 40), 40)
end if
CityStZip = left(trimright(CityStZip) + Space( 40 ), 40)

if {XDDFile_Wrk.RecSection} = "20P" then

Formula = ">171>" _
+ CityStZip _


end if
 
hi,

You already have 45 characters (5 from ">171>" and 40 from CityStZip) in your Formula result BUT...

...you apparently did not include the continuation of the formula

[pre]
Formula = ">171>" _
+ CityStZip[highlight #FCE94F] _[/highlight]
?????????????
[/pre]

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Thanks for your help! Just was told that the ">171>" indicates the space where the prior field left off.
Thanks for pointing out I left a hanger-oner on the formula with an unaccompanied _
 
So you're stating that the final contents of CityStZip is 67 BYTES in length, rather than 40?

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top