Wednesday, 16 December 2015

Fetech contacts data in excel sheet through visual force page


<apex:page controller="FetchdatathroughCSV" sidebar="false" action="{!Fetechdata}" cache="false" contentType="text/plain/#contacts.csv">
<apex:repeat value="{!con}" var="r">
  {!r.firstname}{!r.lastname}
</apex:repeat>
</apex:page>
public class FetchdatathroughCSV {  public List<Contact> con {get;set;}  public PageReference Fetechdata()  {    con = [Select Id ,firstName ,LastName from contact limit 10];    return null;  } }

No comments:

Post a Comment