logo

Display Rich Text fields in a view


Ever wanted to show part of a Rich Text field in the column of a view. I'll bet my grandma that you have. Well this is possibly the easiest/only way; I can't believe I didn't know about this simple @Function sooner !!!

@Abstract lets you create a plain text summary of a rich text field. Superb. Using this function to compute the value of a plain text field, stored in the document, means that the data can be displayed in views. What a blessing. I'm going to use this all the time now ;-) You can see it in action by using the search on this site.

First thing to do is to create a Computed field, of type Text, and call it something like "Abstract". The formula for this will be somthing like :

@If(@IsAvailable(name_of_the_rt_field); @Abstract( [Abbrev]; 200; ""; "name_of_the_rt_field");"" )
*

This example will take the first two hundred characters of the named rich text field and abbreviate its content. This can then be displayed in views as a kind of intro to the document. Cool hey !?

* The help database will give you more detail on the powerful features of this function

Feedback

  1. This is really good...

    Using @Abstract is an excellent way of developing a summary to return in a search view...giving the user something familiar like they would get with a standard internet search on Yahoo, etc...

  2. What if...?

    What if there's an attachment in the rich text field? What would be stored/displayed in the the "abstract" field then?

    1. There is only one way to find out!

      Show the rest of this thread

      • avatar
      • Vei CHong
      • Sun 7 Jan 2007

      Re: What if...?

      yo man i'm the real vei chong who are u ?

  3. Only works for single byte char set though

    Note that this function doesn't work for a double byte character set.

    This means you can't use it for applications that have Japanese content for example.

  4. Image from a RTF in a view

    Doing my job, making a graphical assets database for our PR department: I have a form with a rich text field where NotesClient users can, beside other discriptive fields, put in a thumbnail image with the help of a file navigator. A button with some @PROMPT([LOCALBROWSE}.. and some @Commands to fill the RTfield will do the job. The next step is to place these thumbnails in a view...and that's where the story ends. The first place where I did find something about this subject is in the Designer Helpfile; about extracting text out of a rich text field with @Abstract.. . On the internet you can find a lot of developers who also present the same hint. But how can I extract an image out of a rich text field to display in my view? It can't be true that this is nearly impossible or is it a well kept secret or is it that we don't need such a feature?

    1. RTF Image to another form

      Hi, Everytime a new document is saved, it has an image pasted in RTF, I need to copy that to another form or page, so I can have a page or form that shows all the images on 1 page(s). There will not be a lot of images, I just need to quickly see all the images together that have been saved on individual documents. Thanks Ron

    • avatar
    • purple
    • Fri 13 Dec 2002

    Java Applet

    Jake, I tested using a rich text field with 'Web Access Display Using Java Applet'. Not working. I change the field to 'Using HTML', it works. Any idea how to solve this? I need to display the value in a view as a summary of what user keyed in the RTF. Thanks.

    • avatar
    • Sam
    • Sun 26 Jan 2003

    anyway to include formatting as well?

    alrite, that helps alot ;) but what if i like to display the formatted contents of the RT field? for example, think of a forum where users post messages using a rich text applet, then i want to display all the posts together on one page (like many of the common msgboards these days), is there a way to achieve this?

    thnaks :)

  5. This is really wonderful!

  6. Display Rich Text fields in a view

    Thank You, Thank You, Thank You, Thank You

    • avatar
    • Mar
    • Fri 27 Feb 2004

    And the formatted text?

    What about keeping the format of the text in the rich text?

    • avatar
    • Bonita
    • Thu 11 Mar 2004

    Doesn't work with that godawful Java applet!

    I was so excited to find this idea, but was sooo bummed when it didn't work in my form. We chose long ago to use the Java editor applet for editing rich text fields because it gave our end users some formatting capabilities w/o having to learn to write HTML code. Apparently, these RTF fields saved by the java applet are converted to MIME and don't work too well with @Abstract. If anyone has a way around it, I'd love love love to hear it!!

  7. No Rich Text

    Well for some reason my Rich Text field is not avaible. It displays in the document view, but in the view it fails to show up. OK, what is the trick in setting up the view?

      • avatar
      • Spaceman Spiff
      • Wed 5 Jan 2005

      Re: No Rich Text

      The Domino Designer Help says: "If Notes/Domino cannot locate a field by name, it uses the string literal instead." So that's why you may be seeing your field name in the view. I'm getting the same thing though...

      Comment_1 is a rich text field that most definitely exists on my form.

      If I use the following formula @Abstract( [Abbrev]; 20; ""; "Comment_1") the column is filled with "Comment_1".

      If I use the full formula as proposed by Jake @If(@IsAvailable(Comment_1); @Abstract( [Abbrev]; 1; ""; "Comment_1");"xx" ); the column is filled with "xx".

      So that leads me to believe that the Comment_1 field cannot be found by the view?

      So I have the same question as Louis: what do I need to set up the view / column formula correctly?

      Hide the rest of this thread

        • avatar
        • Spaceman Spiff
        • Wed 5 Jan 2005

        Too quick

        Hello, me again, solved my own problem (and probably that of Louis also), by reading the text THOROUGHLY this time... It is not the rich text field you show in the view, but the calculated field...

        My only problem now is to recalculate all the documents, without changing the "last updated by" and "last updated on" fields on the form, so that the users are not "surprised"...

        but that's another problem all together...

  8. Display Rich Text fields in a view

    It did't work for me. I actually want to display a rich text in a view in the web web but the method did't solve my problem. what can I do

  9. This is good

    this is good, but what happend when we want to display some image in view.

  10. Hi,

    This used to work great, but just had an end user saying it wasn't working any more. Upon investigation found this in the Help for @Abstract: "@Abstract cannot convert rich text to text in a view column"

    Anyone know of a new way to do this now that @Abstract is no longer an option.

    Thanks,

    Brad

      • avatar
      • Jake Howlett
      • Tue 6 Mar 2012

      It used to work in a view?

      Why not use a computed text field to store the abstract value?

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:



Navigate other articles in the category "Views"

« Previous Article Next Article »
None Found   Control the look of the "No documents found" message

About This Article

Author: Jake Howlett
Category: Views
Keywords: Rich Text; Column; Abstract; Views;

Options

Feedback
Print Friendly

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »