I have a Multiline Text column in SharePoint list with Plain Text format. Which will show the activity log for each record/item. Using workflow/ event receiver I  have to update this column when ever an item created or modified with the below format:

04/03/2012 10:42:17 AM XYZ created this document 04/09/2012 10:43:07 AM ABC modified this document 04/15/2012 11:38:59 AM LMN modified this document

Everything was working fine till the time I use SharePoint default Display form. When I tried to customize the custom display form(new display form created and set as default display form using SPD 2010, the line breaks updated in the Multiline Text column was not rendering with line breaks. It was rendering like one paragraph instead of adding line breaks after each activity log as shown below:

04/03/2012 10:42:17 AM XYZ created this document 04/09/2012 10:43:07 AM ABC modified this document 04/15/2012 11:38:59 AM LMN modified this document

Solution :

To resolve this issue, I used the follwoing XSL expression. It was working as expected.

<xsl:value-of disable-output-escaping=”yes”   select=”ddwrt:AutoNewLine(string(@History))” ddwrt:nbsp-preserve = “yes”/>

Here,

  • History is my Multiline Text column in SharePoint list with Plain Text format
  • ddwrt:AutoNewLine is to apply Line Breaks
  • ddwrt:nbsp-preserve is to Disable Special Characters

Happy SharePointing :)