Forum Discussion

DanielChan's avatar
DanielChan
Qrew Trainee
6 years ago

display first few lines of text in pdf report


I have a multi-line text (comment) field - some entries are quite long.  For a pdf report, I would like to display only the first few lines.  Is this possible?
  • I typically use this formula when needing to show a partial set of characters from a multi-line text field.

    If(Length([Comments])<180,[Comments],Left([Comments],180)&"<br><a href='"&URLRoot()&"db/"&Dbid()&"?a=dr&rid="&[Record ID#]&"&dfid=10' title='" &
    List(" ",Part([Comments],1," ' "),Part([Comments],2," ' "),Part([Comments],3," ' "),Part([Comments],4," ' ")) & "'>more</a>")


    What this does is to identify if the length of the field content is more than a specified # of characters long; and then displays the first number of characters, with a hyperlink option more which will show the rest of the characters in a modal that displays when you hover on the more link.  You can change the length of characters depending on your requirements.

    There are some other techniques if you need more complexity; but this is the most common form I use for this.
    • EricFixler1's avatar
      EricFixler1
      Qrew Trainee
      Laura:

      The formula works well, but I have some records that the text field is rather long and the hover window seems to get cut off at a fixed character count.  I do not know where to extend or expand on that count.  Adding Part([Comments],5," ' " etc doesn't seem to expand the display hover window.  Thanks for your assistance.


      ------------------------------
      Eric Fixler
      ------------------------------
  • You can use a formula field and the left function to show a specific number of characters (lines):