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
SScholtzSScholtz 

Visual Force as Excel: Multiple CSS classes not supported?

I'm trying to rendering a VF page as an excel file and css classes are not being applied when you have something referencing multiple css classes.

Example:
 
<apex:page
        showHeader="false"
        sidebar="false"
        standardStylesheets="false"
        applyBodyTag="false"
        applyHtmlTag="false"
        contentType="application/vnd.ms-excel#test.xls"
    >
    <html>
    <head>
    <style>
        .oneStyle {
            background-color: #f00;
        }  

        .anotherStyle {
            color: #0f0;
        }
    </style>
    </head>
    <body>
    <table>
    <tr>
        <td class="oneStyle">Works</td>
        <td class="anotherStyle">Works</td>
        <td class="oneStyle anotherStyle">Doesn't work at all, no styles</td>
    </tr>
    </table>
    </body>
    </html>
    
    </apex:page>



I can get around this by by doing inline styling or doing something weird like creating lots of combo styles (ex. oneStyle-anotherStyle) but that's all pretty ridiculous.

Has anyone run into this before?  Known issue?  I don't expect the Excel rendering engine in Salesforce to be super robust, but this seems like pretty basic CSS support.

Using Summer '15, API v34
NagaNaga (Salesforce Developers) 
Hi Shagz,
 

Visualforce tags are not supported in the Excel doc (visualforce page rendered as Excel). So in order to enforce no text wrapping and displaying borders for the block, we will have to design visualforce page in purely HTML format.



Please see the link below which had a similar conversation that went on

https://developer.salesforce.com/forums/?id=906F0000000972WIAQ

http://salesforcesource.blogspot.com/2009/04/how-to-create-word-pdf-or-excel-files.html

Best Regards
Naga Kiran