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
jay209jay209 

How to Download all Data from tables from a vf page


0down votefavoriteI got a requirement to get data from all the tables present in the vf page for example: we have 100 records, i have customized page into a list view with 10 records per page. Now i have a button called Export, by clicking on that button i need to download all 100 records, as a csv file.please help on this guys
Note: Exporting data without using jquery.
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Jayaram Prasad,
  • Heads up - The below sample code that loops over Contact ID and Name fields isn't considered production quality and should be subjected to your full development life-cycle, including UAT
  • There may be a requirement to generate lists of Salesforce data outside of the standard reporting interface
This is possible using simple Visualforce code
The Visualforce page can use the <apex:column> tag to repeat over SObject or custom wrapper class rows
The <apex:page> tag should use showHeader="false" renderAs="pdf" orcontentType="application/vnd.ms-excel#SalesForceExport.xls", depending on whether you want a PDF or Excel file
Note: The presence of pageBlock (with or without pageBlockTable) will sometimes produce javascript in the export, so for header information that doesn't need to be in your dataTable, you can use  <table>, <tr> and <td> and other table related HTML tags.

Please refer the below link for reference.
https://help.salesforce.com/articleView?id=000003176&type=1 

Best Regards
Rahul Kumar