You need to sign in to do that
Don't have an account?
udayar_jayam
How to add new line in plain text
Hi All,
I trying to download program for contact object , the user click the "Download" custom button it should download all the records from the object. This download file should in text format(.txt).when i download a file it display like this
johnkumarjane but i want to display like this in text file
john
kumar
jane
how to add break line in controller please anyone advice me.
public class contactquery{ public List<Contact> cs{get; set;} public string empId; public contactquery() { cs = new List<Contact>(); for (Contact c : [Select id, Name from Contact ]) { cs.add(c); } } } Vf Page: <apex:page Controller="contactquery" contentType="text/plain/#emp.txt" cache="true"> <apex:repeat value="{!cs}" var="contact"> <apex:outputText value="{!contact.Name}" escape="false"/><br/> </apex:repeat> </apex:page>
Its the outputtext that causes everything to stick on one line - if you just use plain merge fields it works okay - for example, this code:
produces the following output from my dev org:
Obviously you lose the capability to format that outputtext gives you, so this might not be suitable for your use case.
Hi Bob
Thanks for reply im already tried this format but its not working well now also i tried your same code it showing like this
Name;CityBurlington Textiles Corp of America;BurlingtonDickenson plc;LawrenceEdge Communications;
What tool are you using to open the file in? I open it in any text editor and it looks fine.
Notepad
I don't know what to tell you - it looks fine in every text editor I've tried.