4 Replies Latest reply: Apr 26, 2013 4:11 AM by Uva RSS

    Problem with Rpadding in RTF

    Uva
      Hi all,
      I have a requirement in RTF to add '*' after name column in a particular box, which has two lines.
      For Example :
      oracle********
      *************
      I tried using RPADING

      <?xdoxslt:rpad(name,45,' *')?>

      In the above code name column may vary, which may be 10 character or 20 characters or more.

      But With my code if my name is few characters some space is left blank, which shouldn't happen.
      On the other side if my name is of more characters '*' is going to the next line, even this shouldn't happen.

      I am confused what is length of * should be given.

      Please help me with the same.

      Thanks in advance.

      Regards,
      Uva

      Edited by: Uva on Apr 25, 2013 10:08 PM

      Edited by: Uva on Apr 25, 2013 10:30 PM
        • 1. Re: Problem with Rpadding in RTF
          AlexAnd
          it looks like working way
          re-check plz
          <?xdoxslt:rpad(name,45,' *')?>
          try also
          <?xdofx:rpad(name,45,'*')?>
          But With my code if my name is few characters some space is left blank, which shouldn't happen.
          strange
          On the other side if my name is of more characters '*' is going to the next line, even this shouldn't happen.
          so your 'name' is more then 45 so next line. ok
          I am confused what is length of * should be given.
          it's know only you
          it's your business process


          --add
          >
          Handle:      Uva
          Status Level:      Newbie
          Registered:      Dec 6, 2012
          Total Posts:      12
          Total Questions:      7 (7 unresolved)
          >
          plz close threads if answered
          it useful for other

          Edited by: AlexAnd on Apr 25, 2013 11:58 PM
          • 2. Re: Problem with Rpadding in RTF
            Uva
            Hi AlexAnd,
            Thanks for your reply.

            The code is not working properly.

            My business requirement is that,
            I have box which contains two lines which should be printed with the Name and followed my '*' in the rest of space(It shouldn't have free space and it shouldn't exceed more than 2 lines).

            I simply tried by giving some random RPAD length(In the above mentioned one 45 is the sample one given for understanding)

            if name is 'oracle' then, ?xdoxslt:rpad(name,x,' *')?>, let x be any value .

            The the output is

            Oracle**********
            ***************

            with the same x value and my name is 'oracle RTF' then output is like this

            Oracle RTF ******
            ***************
            **

            with the same value x if my name is 'ORA' then output is like this

            Ora************
            ***********

            please see the difference of the Three mentioned examples. I want exactly to be completed in two lines irrespective of the length of the NAME.


            to the more even I have tried with <?xdofx:rpad(name,45,'*')?>
            still same result.
            • 3. Re: Problem with Rpadding in RTF
              AlexAnd
              The code is not working properly
              not quite true

              >
              The the output is

              Oracle**********
              ***************

              with the same x value and my name is 'oracle RTF' then output is like this

              Oracle RTF ******
              ***************
              **

              with the same value x if my name is 'ORA' then output is like this

              Ora************
              ***********

              please see the difference of the Three mentioned examples. I want exactly to be completed in two lines irrespective of the length of the NAME.

              to the more even I have tried with <?xdofx:rpad(name,45,'*')?>
              still same result.
              >
              so that's right
              you can look at your font and see also what symbol has own width

              so you have offset

              for checking you can set font "Courier New" or "Courier"
              >
              In a fixed-width font (such as Courier New), the characters are all the same width: an “i” is the same width as an “m”.
              >
              from http://www.linguistics.ucsb.edu/faculty/cumming/WordForLinguists/Typography.htm
              • 4. Re: Problem with Rpadding in RTF
                Uva
                Thanks AlexAnd you have solved my issue.

                Regards
                Uva.