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
Salesforce_NikitaSalesforce_Nikita 

Export to Excel from Visual Force

Hi,

Is there a way to Export to Excel directly from Visual Force Page through a link?

Thanks in Advance
hitesh90hitesh90
Hello Nikita,

what you want to export? any visualforce page or some other thing?
can you please clarify it.

if you want to export any visualforce page then refer below link:
http://www.salesforce.com/us/developer/docs/pages/Content/pages_styling_content_type.htm

use contentType="application/vnd.ms-excel" attribute on <apex:page > tag.

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
Email :- hiteshpatel.aspl@gmail.com
My Blog:- http://mrjavascript.blogspot.in/
praveen murugesanpraveen murugesan
Could you please explain your requirement bit briefly..

Salesforce_NikitaSalesforce_Nikita
On Visual force Page there is a table of data. This needs to be exported to a excel by clicking on a link and without using any intermediate step

Thanks in Advance
MagulanDuraipandianMagulanDuraipandian
Hi,
By clicking the link, redirect it to a vf page, where rendered is excel type.

http://www.infallibletechie.com/2012/08/export-using-apex-code-in-salesforce.html

If this solves your problem, kindly mark it as the best answer.

Regards,
Magulan
http://www.infallibletechie.com
Salesforce_NikitaSalesforce_Nikita
Hi,

Is there a way to do it without redirecting it to any other visual force page.

Thanks in advance
Mrc2240Mrc2240
Hi, 

Both Hitesh and Magu are correct, we also have instances where we need information in a table that is currently on a visualforce page exported to excel. 

By clicking the link, it will not necessarily open up another visual force page, instead, it will open up a dialogue box asking whether you want to save this excel/csv file or open. 

Thanks