You need to sign in to do that
Don't have an account?
alexander yurpolsky
Custom Export Button
Hi all,
Is it possible to create a custom button implementing the "Export Details" functionality on Selected View?
To be in detail, in my Contact list view which lists contacts based on the Selected View (All Contacts, My Contacts, Recently Viewed..), is it possible to have a custom "Export" button which will export the selected contacts to local Excel file OR send the the data to excel online ? Basically I just want to create a custom "Export" button to export the selected contact details to my local machine/excel online . Any suggestion would be of really a great help guys
Thanks in advance
Is it possible to create a custom button implementing the "Export Details" functionality on Selected View?
To be in detail, in my Contact list view which lists contacts based on the Selected View (All Contacts, My Contacts, Recently Viewed..), is it possible to have a custom "Export" button which will export the selected contacts to local Excel file OR send the the data to excel online ? Basically I just want to create a custom "Export" button to export the selected contact details to my local machine/excel online . Any suggestion would be of really a great help guys
Thanks in advance
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
Tested on IE8, Firefox, Chrome.
Excel appears to coerce the font to Arial Unicode MS 10pt which is a good font for UTF-8.
https://developer.salesforce.com/forums/?id=906F0000000962nIAA
All Answers
The main problem is the default pagesize (20 by default) that needs an apex controller.
1) List Button (create the Visualforce page + controller below at first)
2) Add the button to the Account List View
Visualforce page: the standardController detects the context for the current list. contentType="application/vnd.ms-excel#SalesForceExport.xls" will do all the needed work.
A controller just to set the Page Size.
Alain
Please refer below code. You have to modify it according to your requirements but this will surely help you.
After developing the functionality, create a custom button of list Button type.
If this solves your issue, please mark it as best answer.
Thank you for your help and patience :)
<apex:pageBlock>
<apex:pageBlockTable value="{!accounts}" var="acc" border="1" >
<apex:column value="{!acc.name}"/>
<apex:column value="{!acc.Rating}"/>
<apex:column value="{!acc.Website}"/>
<apex:column value="{!acc.type}"/>
</apex:pageBlockTable>
</apex:pageBlock>
After downloading the file, open the file in notepad++ or any other text editor and check if you are getting the same problem of encoding.
After downloading the file and opening it via Notepad I can see the records correctly.
But in Excel I see only strange signs. Is there a way to download the file with universal encoding or something similar?
With Chrome, the export appears some seconds just at the bottom of the page like any other exports (I made a dozen of exports with the button above) The screen itself doesn't change at zero because there is no navigation at all here
Copy/paste all the definition of your work (fresh eyes could help to see obvious errors).
But I still have an encodoing problem with some of my records. Is there anything to do with it?
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
Tested on IE8, Firefox, Chrome.
Excel appears to coerce the font to Arial Unicode MS 10pt which is a good font for UTF-8.
https://developer.salesforce.com/forums/?id=906F0000000962nIAA