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
learn_cloudsflearn_cloudsf 

renderas" attribute to display o/p in the form of Excel Shee

    What is the value of "renderas" attribute to display o/p in the form of Excel Sheet?
Tejas KardileTejas Kardile
Hi,

You have to set below value in order to get an output in excel.

<apex:page contentType="application/vnd.ms-excel#SalesForceExport.xls" cache="true">
    <table>
        <tr>
             <td>
                <img src="http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif"/>
            </td>
        </tr>
    </table>
</apex:page>

Thanks.
 
Naveen MosuruNaveen Mosuru
Hello learn_cloudsf,

In order to generate excel file, renderAs attribute is not used. Instead of that try to use contentType attribute.
<apex:page contentType="application/vnd.ms-excel">

Thank You,
Naveen.