cancel
Showing results for 
Search instead for 
Did you mean: 

SmartStyles: Using Tabs to Right and Left align

Former Member
0 Kudos

In my main window I am printing a table of a bunch of currency fields. I have them all right aligned which is step 1. Step 2 is to left align the dollar sign '$'. The text field I am printing in the column currently looks like this: $&WA_LINEITEMS-PRINCIPAL_DUE&. I took all the tabs out since it wasn't working right anyway. I know it can be done using tabs but I am just not having any luck. Either I end up with the dollar sign lined up correctly and the amount wrong, or vice versa. Thanks guys.

To try and make clear: I want to left align the '$' and right align the amount value inside the same text field.

For Example: $ 555,555.00

$ 444.00

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

ok do the following:

make yourself a paragraph format in your smartstyle. i call it XX, but this is just an example.

now in your paragraph format XX you need to create two tabs.

first one should have a left alignment and second a right alingment.

Now its getting a lil tricky.

Make sure the value of you first tab is big enough.

Example: you have 20 characters of text written already in the actual line, so you first tab should have at least a position of 21 characters left.

the Difference between tab position 1 and 2 has to be big enough to fit in the desired variable holding you amount.

ERxample: lets assume your tab 1 has a position of 25 chars left. you amount has amaximum value of 10 chars. so your tab 2 has to be at least 35 chars right.

i hope this gives you enough input to have an idea how things are working.

if not try to ask more specified

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

I see the answer of Florian is very complete and correct.

So i do not have to explain that myself.

I can only add 1 small comment.

your text element will have the following content: ,,$,,&WA_LINEITEMS-PRINCIPAL_DUE(C)&

Gr., Frank

Former Member
0 Kudos

Frank, I think you got mixed up with sapscripts. The ,, is used to signify a tab in sapscript but that's not the same case for smartforms. In smartforms you just hit the tab button on the keyboard. Thanks.

Former Member
0 Kudos

hi Brett,

you are completely right. i got mixed up. Sorry.

Gr., Frank

Former Member
0 Kudos

actually Frank didnt got mixed up. As he´s a good developer he uses the line editor and not the text_edit control.

there you still need to give a tab as ,,.

Former Member
0 Kudos

Hi Brett,

with the same text field you won't be able to get the desired output. Use 2 textfields,

and use left aligned paragraph format for $ and right aligned paragraph format for amount.

That should do the trick.