By using this website, you agree to our Terms of Use (click here)
Is there a way to pad a string in the Report Designer? I tried using PadLeft and I receive an error stating that you can only pad a one character field. My goal is to use the concat function to string variables, but I need to pad left on one of the variables. In my formula I can use PadLeft('_',10,' ') and the underscore is padded left. However I would like to padleft('USD',10,' '); is there a way to achieve this option?
What would you want the end result to look like?
Are you trying to create an amount like this where there is a variable number of spaces between USD and the number?
USD 120.00
So you want to pad it with spaces, but you could need a different number of spaces depending on how long the number on the left is?
Do you always know how many characters the entire thing should be, starting from the "A" all the way until the "USD"?
Yes I will always know how many character starting from 'A' to the 'USD'
What if you use a combination of Len and PadLeft?
Len will tell you the length of a string. So you could use Len on A0000000013521070067000301429001600 (I'm assuming that the length could vary depending on the data), then back into the number of spaces that you need to feed to PadLeft by subtracting the Len value from the fixed length of the entire thing.
Thanks for your help.
Were you able to solve the problem? If so, I'd love to see the formula that you came up with.
