You need to sign in to do that
Don't have an account?

Creating Excel CSV file with contents in separate columns using only Apex
I am able to created an excel csv file attaching it with my mail. But all the information is being put inside the first column. I want to place the separate field values in separate columns. Can anyone suggest how can I do it using only Apex (as that is my strict requirement) and not using VisualForce or any plugins or xml file ?
String content = 'Sr No., Col A, Col B \n';
then in loo use it like -
content += i + ',' + Val Col A + ',' + Val Col B + '\n';
If your column value with comma then keep them in double quote in above string concatenation.
Hope this helps :)
All Answers
String content = 'Sr No., Col A, Col B \n';
then in loo use it like -
content += i + ',' + Val Col A + ',' + Val Col B + '\n';
If your column value with comma then keep them in double quote in above string concatenation.
Hope this helps :)