You need to sign in to do that
Don't have an account?

Styles were not applied when I downloaded the VF page in Excel Format
Hi all,
I have developeed a VF page and downloading the page in excel format on button click using contentType="application/vnd.ms-excel#FILENAME.xls" cache="true"
Please note that my entire page is in HTML table format using the style attributes and style classes.
After downloading the excel file, I am unable to see any style which I have mentioned in the VF Page. For eg. The background color of the page is Red and when I downloaded it is normal in excel file.
Can someone please help me to overcome this problem ?
Thanks,
Manu
I have developeed a VF page and downloading the page in excel format on button click using contentType="application/vnd.ms-excel#FILENAME.xls" cache="true"
Please note that my entire page is in HTML table format using the style attributes and style classes.
After downloading the excel file, I am unable to see any style which I have mentioned in the VF Page. For eg. The background color of the page is Red and when I downloaded it is normal in excel file.
Can someone please help me to overcome this problem ?
Thanks,
Manu
Can you please share your code?
Thanks,
Vatsal
Here is the code ..
<apex:page standardController="Account" applyBodyTag="false" applyHtmlTag="false" standardStylesheets="false" showHeader="false" contentType="application/vnd.ms-excel#FILENAME.xls" cache="true" >
<head>
<style>
.section1{
background-color:red;
}
</style>
</head>
<body>
<table width="100%" class="section1">
<tr>
<td colspan="16" style="text-align:center"><b>Account Name</b></td>
</tr>
</table>
</body>
</apex:page>
Please note that I am facing the followng problems -
1. The background color of table is not red.
2. The Label Account Name is not aligned to Center.
Thanks,
Manu
Not sure how come this is working for you but still not working for me. I am downloading .xls file and opening through open office, no styles were visible. Can you tell me how you have opened the file(using MS-Excel?)
Thanks,
Manu