cancel
Showing results for 
Search instead for 
Did you mean: 

Adding White Space to Help with Formatting

Former Member
0 Kudos

Moving right along and now comes the fun part -- formatting. Usually I would just use the built in editor features, but the string is concatenated to display Wd x Ht x Dp depending on a condition.

While it currently displays ok, I need to pad out each field with white spaces (and center) to align with my headers above.

Wd, Ht and Dp are currently defined as strings, is it possible to format and center using white spaces and calculating the length of each value?

global stringvar Width := totext({width},0,"")
global stringvar Height := totext({height},0,"")
global stringvar Depth := totext({depth},0,"")

Default Condition:

(Width) & ' X ' & (Height) & ' X ' & (Depth)

Gary

Accepted Solutions (0)

Answers (4)

Answers (4)

DellSC
Active Contributor
0 Kudos

Is there a particular reason why you can't just make the text box a specific width and center its contents?

-Dell

Former Member
0 Kudos

Because I have a flair for over complicating the simplest of things. I've made a text box and monkeyed with some manual spacing. While it's not perfect, it does align itself a little better. It will work for now but a proper solution will always be on my list. OCD does this to a person.

Gary

DellSC
Active Contributor
0 Kudos

Or, as I say to my daughter, CDO, for those who are so bad it has to be in alphabetical order. 😄

Former Member
0 Kudos

Sure, here it is. Understanding that width, height and depth values can be both 4 characters each. I manually put in 4 spaces each to at least clean it up a bit.

width-height-depth.png

Gary

Former Member
0 Kudos

If you do not want to use fixed length font you will need to convert to 3 fields. So instead of changing order of a concatenated string. Create 3 formulae, for Position 1 which changes from width, depth or height., repeat for position 2 & 3.

Place these formula fields on designer, align with your headers and then place text boxes with X between,

Ian

Former Member
0 Kudos

I thought of this as well, will toy with that idea today actually. I would prefer though to keep it all one, as each condition triggers the format of Width, Height and Depth.

Gary

abhilash_kumar
Active Contributor
0 Kudos

Hi Gary,

Could you please post a screenshot of how the alignment is right now?

I'm guessing you'd have to use a fixed-width font to get it perfectly aligned.

-Abhilash