Skip to Content
avatar image
Former Member

How to fill the blank spaces with dots?

Hi,

i have a text object in my report which is used to display the String that is retrieved from the DB.Now my problem is that at the end of the String i will have to fill it with dots for the last line alone.For example

Patient alcohol history...................

"Patient alcohol History" is the string that i got from the DB.The string can be more than one line also in that case i will have to fill the last line empty spaces with dots.How can i do that

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jun 28, 2010 at 11:49 AM

    For a single line, and need to pad to 50 characters with dots

    @dots

    local numbervar n:= 50-length(yourtextfield);

    local stringvar name:= yourtextfield;

    while n <> 51

    do

    (name:= name&'.';

    n:=n+1;);

    name;

    For multiple lines you will need to test length eg again sticking with 50 limit on wrapped lines

    @dots

    If length(yourtextfield) > 100 then

    local numbervar n:= 150-length(yourtextfield)

    If length(yourtextfield) > 50 then

    local numbervar n:= 100-length(yourtextfield)

    else

    local numbervar n:= 50-length(yourtextfield);

    local stringvar name:= yourtextfield;

    while n <> 51

    do

    (name:= name&'.';

    n:=n+1;);

    name;

    Ian

    Add comment
    10|10000 characters needed characters exceeded