function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rayneshraynesh 

Print Anything and line breaks

Hi,

I'm fairly new to salesforce but we've recently installed the "Print Anything" application so we can develop printable HTML versions of our data.

Currently im working on making a printable version of Events but I'm having a problem in displaying string data that has line breaks.  Like on Salesforce the description field will show the line breaks as entered, but in the Print Anything template that i've created it seems to be removing all the line breaks.

I've had a similar problem before using ASP.NET.... but they way I got around to that was replacing any line breaks with <br />

Is there any way of doing something similar in Print Anything, SOQL... or any suggestions would be highly appreciated!

Thanks!!!
Best Answer chosen by Admin (Salesforce Developers) 
francisgfrancisg
The value returned from Salesforce is the New line character 0A(10) for each line in the text area. When this gets added to the DOM this gets translated to a space. Therefore, any processing on this field must be done at the premerge stage.

e.g mergeData["Task1.Description"] = mergeData["Task1.Description"] .replace( new RegExp( "\n", "g" ), "<BR>" );
Message Edited by francisg on 03-09-2009 05:07 AM

All Answers

DmitriEchoLaneDmitriEchoLane
    Hi, I am having the same issue.
Have you been able to solve this?

This is critical if you try to display the text(long) or text(area) fields on the quote.

Your assistance is greatly appreciated.

Thanks,
Dmitri
francisgfrancisg
The value returned from Salesforce is the New line character 0A(10) for each line in the text area. When this gets added to the DOM this gets translated to a space. Therefore, any processing on this field must be done at the premerge stage.

e.g mergeData["Task1.Description"] = mergeData["Task1.Description"] .replace( new RegExp( "\n", "g" ), "<BR>" );
Message Edited by francisg on 03-09-2009 05:07 AM
This was selected as the best answer