• Cheers
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Problem:

 

You have a VF page that you want to output as Excel but the line breaks in your TextArea fields cause Excel to create new rows at each line break rather than preserve the line breaks within the cell as if you had used ALT-ENTER (or your line breaks are lost altogether and the text is run on with no breaks)

 

Example:

 

SFDC TextArea field contains:

"Line 1

Line 2"

 

(or "Line 1\nLine 2")

 

Your output in Excel should be one row with the cell preserving the line breaks but you either:

 

a) get two rows, broken at the line break

b) one row but the line break is lost and the text is run-on

 

Solution follows in the next post