VF-Page
<apex:page standardController="Task" extensions="CtrlContactExport" contenttype="application/vnd.ms-excel⌗Export_Contacts.csv">RNAME1;RNAME2;RSTREET;RHHOUSENO;RPOSTAL;RCOUNTRY;RPHONE;REMAIL
<apex:repeat value="{!list_contacts}" var="c" >
"{!c.Name}";"{!c.Salutation}";"{!c.MailingStreet}";"{!c.MailingStreet}";"{!c.MailingPostalCode}";"{!c.MailingCountry}";"{!c.Phone}";"{!c.Email}"
</apex:repeat>
</apex:page>
Controller
Thanks for advicePeterpublic class CtrlContactExport {
public list<Contact> list_contacts {get;set;}
public CtrlContactExport (ApexPages.StandardController controller){
exportContacts();
}
public Pagereference exportContacts(){
list_contacts = [SELECT Name, Salutation, MailingStreet, MailingPostalCode, MailingCity, MailingCountry, Phone, Email FROM Contact];
return new Pagereference('');
}
}
Hi Peter,This is a blog post for export data in lightning on button click.you can create your excel file by directly calling <aura:handler inithttp://sfdcmonkey.com/2017/04/19/download-csv-file-data-salesforce-lightning-component/and use this component on quick action button.Regards Ashif