BaBernd
20th July 2015, 11:27
Hello to All,

in reports programming mostly my headers are strings (left alignemt) and the number are integer or Long values with right Alignement.
Now in some cases I also like to Change the right alignment of the number to left alignment. But in Report the alignment Option is always disabled.
So I've tried to create a Domain like tcpono but as tcpono.left. When I tried I've recognized that during creation of a Domain the alignment is also disabled.
So now my last hope is to Change the alignment with the Display Format. For example Format for tcpono is "ZZZ9". Is there a possibility to write Format instructions for left alignemnt? For example like "9ZZZ".

Or is there another method?

Thanks for help in advance.

Best Regards Bernd

bhushanchanda
20th July 2015, 12:34
Hi,

Check sprintf$() function (http://www.baanboard.com/programmers_manual_baanerp_help_functions_formatting_io_sprintf)

Also, you can convert your integer to string and use tt.align.according.domain() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_string_operations_tt_align_according_domain) function.

JaapJD
20th July 2015, 13:51
str$() is the easiest way.

BaBernd
20th July 2015, 16:54
Hi Bhushan, Hi JaapJD,

thanks a lot for help. I've thought there is an easy way. But it seems not so.
Changing into a string is not the solution I've searched for.
So I will Close the thread.
I make an average Rating cause there is no solution available.

Best Regards Bernd

mark_h
20th July 2015, 20:17
Maybe I am missing something - but what exactly are you looking for? I mean you can change a number to a string with str$() - you can also use shiftl to takes a string from right justified to left justified. But when you say zzz9 to 9zzz - that means something different to me. I think you mean just " 1" to "1 " - that you could try the shiftl$ function.

mark_h
21st July 2015, 22:37
I unlocked the thread. Typically we do not lock threads - even after they are answered. That way someone else down the line can ask another question or something about the answer.

bpanda
22nd July 2015, 08:59
Dear BaBernd,

As suggested by Bhusan, you can use below code for your required format.
str.var = sprint$("9ZZZ",LONG_VAR)

if you want to include the long part with some text & make a complete sentence with proper gap then use like below.

Result = trim$(string.1) & " " & trim$(str$(long_var)) & " " & trim$(string.2)

trim$() will remove all the leading & trailing spaces from the string.

If your requirement is something else then please can you share the complete requirement.

Thanks & Regards
Biswajyoti Panda