Wednesday, March 28, 2012

Pad Trailing Spaces in a Report Expression

I am trying to pad a fixed number of trailing spaces into a report expression, as follows:

Data:

CUSTOMER_NAME
-
Michael
Peter
John

Result (e.g. with 10 spaces padded, assuming all names are below 10 characters long):

"Michael "
"Peter "
"John "

Is there an easy way to achieve this ?

Thanks.

Kenny

If you want a 10 character string, right padded with spaces, you could do this:

=Fields!datafield.Value & right(" ", 10 - len(Fields!datafield.Value))

(10 spaces in quotes)

HTH

BobP

No comments:

Post a Comment