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
Manu@devManu@dev 

Visualforce page to be generated in both PDF and MS-Excel on signgle button click

Hi,

How can I generate the VF Page in both PDF and MS Excel ?

I used renderAs="PDF" and contentType="application/vnd.ms-excel#FILENAME.xls" cache="true" on the same VF page but I am able to get only PDF but not excel format. If I remove the renderAs="PDF", then I am able to get excel file. 

How can i achieve both at a time on singlr button click.

Thanks for your help in advance.

R - Manu
Best Answer chosen by Manu@dev
Vatsal KothariVatsal Kothari
Hi Manu,

You can not generate PDF & Excel on the same page, for this you required two different VF pages.

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

Thnaks,
Vatsal

All Answers

Vatsal KothariVatsal Kothari
Hi Manu,

You can not generate PDF & Excel on the same page, for this you required two different VF pages.

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

Thnaks,
Vatsal
This was selected as the best answer
Gaurav NirwalGaurav Nirwal
This type of process can't performed in salesforce
you can use two different VF pages