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
Vanessa BarrosVanessa Barros 

import into a cvs file with break line

hi!

i made the code to import dat from SF to a csv file.

anyone knows how to put a break line to separe in lines?

 

this is the code of the visualforce page

 

<apex:page controller="cobrancasController" cache="true" 
contentType="text/plain/#novosDoadores.csv">

Nome Doador;N contribuinte;Valor;Ref. normalizada BCP; Nib;Id account;N doador\n

<apex:repeat value="{!cs2}" var="doador">

{!doador.Account.name};{!doador.Account.N_Contribuinte__c};{!doador.amount};{!doador.AUX_REF_BCP_PS2__c};{!doador.NIB__c};{!doador.AccountID};{!doador.Account.Numero_novo__c }
</apex:repeat>

</apex:page>



bob_buzzardbob_buzzard

When I've done this in the past, the line breaking is detected automatically from the line breaks in the source.  E.g. if I have:

 

header1;header2;header3;

<apex:repeat>
  columns here!
</apex:repeat>

I get a blank line between the headers and the values.  If I remove the whitespace, the blank line doesn't appear in the output.  

 

header1;header2;header3;
<apex:repeat>
  columns here! 
</apex:repeat>