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
SFDC_2706SFDC_2706 

Cannot display Image in excel sheet...!!

Hello Experts,

I have created excel workbook with help of VF page & XML Spreadsheet Reference. However I am not able to insert the company's logo in the first sheet. Can any one please suggest me how to insert an image in the sheet. Below is the VF code :

<apex:page controller="XYZ_controller" sidebar="false" showHeader="false"  contentType="application/vnd.ms-excel#{!object.Name__c}_Bid_Preview.xls" cache="true" action="{!changeProposalStatus}">
    {!xmlheader}
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
      xmlns:o="urn:schemas-microsoft-com:office:office"
      xmlns:x="urn:schemas-microsoft-com:office:excel"
      xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
      xmlns:html="http://www.w3.org/TR/REC-html40">
         
        <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
            <AllowPNG/>
        </OfficeDocumentSettings>
        
        <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
            <WindowHeight>7845</WindowHeight>
            <WindowWidth>12045</WindowWidth>
            <WindowTopX>630</WindowTopX>
            <WindowTopY>630</WindowTopY>
            <ProtectStructure>False</ProtectStructure>
            <ProtectWindows>False</ProtectWindows>
        </ExcelWorkbook>

<Worksheet ss:Name="Cover">
  <Table>
  <Column ss:Width="70" ss:StyleId="s_plain"/>
  <Column ss:Width="100" ss:StyleId="s_plain"/>
  <Column ss:Width="100" ss:StyleId="s_plain"/>
  <Column ss:Width="250" ss:StyleId="s_plain"/>

    <Row>
        <Cell  ss:Index="2" ss:StyleID="s9_confidential" ss:MergeAcross="3"><Data ss:Type="String">CONFIDENTIAL</Data></Cell>
    </Row>
    <Row></Row>
      
<I NEED TO INSERT AN IMAGE HERE i.e COMPANY'S LOGO> (For testing, any logo will do)

<Row ss:AutoFitHeight="1">
        <Cell  ss:Index="2" ss:StyleID="s_cover_heading" ss:MergeAcross="3"><Data ss:Type="String">Test Data</Data></Cell>
    </Row>
    <Row>
        <Cell  ss:Index="2" ss:StyleID="s_cover_heading_lab" ss:MergeAcross="3"><Data ss:Type="String">Test Data</Data></Cell>
    </Row>
    <Row></Row>
    
</Worksheet> 
   </Workbook>  
</apex:page>
    
I request your swift support and help on this. Your efforts would be greatly appreciated. Thanks in advance...!!
NagendraNagendra (Salesforce Developers) 
Hi Ronu,

Please check with this for similar issue.
https://developer.salesforce.com/forums/?id=906F000000098TOIAY

Hope this helps.

Best Regards,
Nagendra.P
Harish RamachandruniHarish Ramachandruni
Hi,

Use this      <apex:image url="http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif"/>
tag b/w row i think it will resolve .


Regards,
Harish.R.
Tejas KardileTejas Kardile
Hi,

Try below code:

<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,
Tejas