Find your content:

Search form

You are here

How to display image from Static Resource in Excel sheet (generated from VF Page)

 
Share

I have been facing trouble in rendering image from Static Resource. Could any one help with the same?

The error is:

The linked image can not be displayed. The file may have been moved, renamed or deleted. Verify that the link points to the correct file and location

The Static Resource is 'Public'


Attribution to: San Tosh

Possible Suggestion/Solution #1

"public" means accessible from outside over an authenticated connection. So any request needs to include a session id (obtained by the login process) and a request originating from Excel will not have this.

You can provide unauthenticated access to a static resource by setting up a Site and using a URL that starts with the Site domain. Or you can provide access to the image by making it an externally available image Document which is simpler.


Attribution to: Keith C

Possible Suggestion/Solution #2

<img src="https://c.xxX.content.force.com/servlet/servlet.ImageServer?id=documentId&oid=OrgId" width="132" height="65"/>

Replace xxX with serverId

Upload image as document with public access and externally available. use this url format to display in VFPage.


Attribution to: Ranendu Banerjee
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/32065

My Block Status

My Block Content