on 12-03-2008 7:41 AM
Hi experts!!
I have created a 13CM window in smartforms and i want to print a string in it. But if the string is bigger than the line i want to split it and write in another line.
I know strlen returns the length in characters, so how can i do that??
Please help!!
Thank you in advance!!
Calculate number of characters one line can hold.
You may do it by actual writing some text and trial and error to determine it, or calculate from Characters per Inch in Ouput Options of Form Attribute.
Example if you have 10.00 Characters per inch, you will get 10 characters per 2.54 CM.
let's say you calculated that 50 characters can be accomodated in a line.
before writing it in window, you may write a code
data : l_char type i.
l_char = STRLEN( variable ).
if l_char > 50.
l_var1 = variable+0(50).
l_var2 = variable+50(50).
else.....
endif.
BTW, if you want any special splitting if variable greater than a line, it's fine, but if it's simply splitting of text, text should automatically wrap if greater than one line !
Regards,
Mohaiyuddin
Edited by: Mohaiyuddin Soniwala on Dec 3, 2008 1:31 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It will automatically prints in the next line when first line exceeds.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it is possible (i think) to know which font you are using for your text but i don't want to know how to check that out. and as much as you can change the font as much as you have to change your calculation so that doesn't work either. i.e. it is not easy to have a translation between metric size and font size to know how many characters of a string can be used.
normally smartform does automatically wrap the text to the next line when the content is to long.
if you still have to break up your text yourself you can use FM RKD_WORD_WRAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,
in ur window where u want to print the string ,, its better to use template ,
as it adjust accordingly...........
reagards,
prashanti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use template the string line automatically comes to the second line ..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.