• Sushant Patil 73
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello All,
I have a requirement, on button click download the detail page of record as a Word doc, I wrote the below code but when file is getting downloaded cross is coming in place of image (Owner name avatar),  however, I used CSS and javascript to hide all the images from Page but it's not working . Please help. Thanks in advance
<apex:page standardController="opportunity"  contentType="application/msword#Tender_Opportunity.doc" cache="true" showHeader="false" sidebar="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false">
<html xmlns:w="urn:schemas-microsoft-com:office:word">
     <head>
       <style>
       
         .labelCol {
               font-weight: bold;    
               font-family: Calibri;             
                width: 200px;
               text-align: left;

            }
             .dataCol {
                     width: 300px;
                     margin-right: 20px;
           }
           .col02 {
                     width: 300px;
                     margin-right: 20px;
           }    
           a {
                text-decoration: none;
            }   
            img[src=""] {
               display: none;
               visibility: hidden;
            } 
        </style> 
        <script>
        window.onload = function removeImg() {
          var images = document.getElementsByTagName('img');
            for(var i=0; i < images.length; i++) {
                images[i].parentNode.removeChild(images[i]);
            }
        }
        </script>
          <base href="http://blogforce9dev-developer-edition.ap1.force.com/salesforceicons"/>       
     </head>   
     <body>
         <apex:detail subject="{!opportunity.id}" relatedList="false" title="false"/>
     </body>
 </html>
</apex:page>

 
  • April 25, 2018
  • Like
  • 0