• Rahul.Chaudhari
  • NEWBIE
  • 30 Points
  • Member since 2017

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,
I am developing one visualforce page which render as word doc,but the footer is displayed twice in the last page.
=============================sample code=========================
<apex:page standardController="Case"   sidebar="false" showHeader="false"  contentType="application/msword" cache="true" >
    
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
     <style type="text/css">
     
                
         p.MsoHeader, li.MsoHeader, div.MsoHeader{
                    margin:0in;
                    margin-top:.0001pt;
                    mso-pagination:widow-orphan;
                    tab-stops:center 3.0in right 6.0in;
                }
                p.MsoFooter, li.MsoFooter, div.MsoFooter{
                    margin:0in;
                    margin-bottom:.0001pt;
                    mso-pagination:widow-orphan;
                    tab-stops:center 3.0in right 6.0in;
                }
                @page Section1{
                    size:8.5in 11.0in; 
                    margin:0.5in 0.5in 0.5in 0.5in;
                    mso-header-margin:0.5in;
               
                    mso-footer:f1; 
                    mso-footer-margin:0.5in;
                    mso-paper-source:0;
                }
                div.Section1{
                    page:Section1;
                }
                table#hrdftrtbl{
                    margin:0in 0in 0in 9in;
                }
            </style>
</head> 
     <apex:form >
    
    <body>
     <br clear="all" style="page-break-before:always" />
        <div class="Section1">
           <table width="100%" border="1" >
                <tr>
                  <td width="40%" align="Center" style="margin-left: -20px;">
                           
                         
                       <apex:image  width="150" height="75"/>
                       
                   </td>
                    <td width="40%" align="center" >
                     <b><span style="font-size: 20px;">Test Report </span></b><br/>
                     <b><span style="font-size: 16px;padding-left: 5px;">Test Report</span></b> 
                  </td> 
                  
                     <td width="20%" align="center">
                    <span >Created Date:</span> <br/>
                    <apex:outputText value="{0,date,dd'.'MM'.'yyyy}">
                            <apex:param value="{!today()}"/>
                            </apex:outputText><br/>
                            <span style="font-size: 16px;padding-left: 5px;">Version 1</span>
                                               
                         </td>
                
                    
                    
                    
                    
                    </tr> 
                 
            </table><br/>
            
               
            
            </div>
            <div style='mso-element:footer' id="f1" >
                               
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                                     <p class="MsoFooter">
                                        <tr>
                                            <td width="50%" word-spacing="5px">
                                                Constructed: SHEQ{!$User.FirstName} {!$User.LastName}<br/>
                                                VA 7.5.1 Steering documented information of conformity
                                            </td>
                                            <td align="center" width="20%">
                                           <apex:outputText value="{0,date,dd'.'MM'.'yyyy}">
                                            <apex:param value="{!Case.CreatedDate}"/>
                                            </apex:outputText>
                                            </td>
                                            <td align="center" width="30%">
                                                Page <span style='mso-field-code: PAGE '></span> of <span style='mso-field-code: NUMPAGES '></span>
                                                <br/>
                                                Print Date:<apex:outputText value="{0,date,dd'.'MM'.'yyyy}">
                                                <apex:param value="{!today()}"/>
                                                </apex:outputText>
                                            </td>
                                        </tr>
                                        </p>
                                    </table>
                                
                            </div>
                 
                          
        </body>
        
        </apex:form>
        
      
        </apex:page>
=================================================================
=====================sample output============================
User-added image
============================================================
Hi All,
I am developing one visualforce page which render as word doc,but the footer is displayed twice in the last page.
=============================sample code=========================
<apex:page standardController="Case"   sidebar="false" showHeader="false"  contentType="application/msword" cache="true" >
    
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
     <style type="text/css">
     
                
         p.MsoHeader, li.MsoHeader, div.MsoHeader{
                    margin:0in;
                    margin-top:.0001pt;
                    mso-pagination:widow-orphan;
                    tab-stops:center 3.0in right 6.0in;
                }
                p.MsoFooter, li.MsoFooter, div.MsoFooter{
                    margin:0in;
                    margin-bottom:.0001pt;
                    mso-pagination:widow-orphan;
                    tab-stops:center 3.0in right 6.0in;
                }
                @page Section1{
                    size:8.5in 11.0in; 
                    margin:0.5in 0.5in 0.5in 0.5in;
                    mso-header-margin:0.5in;
               
                    mso-footer:f1; 
                    mso-footer-margin:0.5in;
                    mso-paper-source:0;
                }
                div.Section1{
                    page:Section1;
                }
                table#hrdftrtbl{
                    margin:0in 0in 0in 9in;
                }
            </style>
</head> 
     <apex:form >
    
    <body>
     <br clear="all" style="page-break-before:always" />
        <div class="Section1">
           <table width="100%" border="1" >
                <tr>
                  <td width="40%" align="Center" style="margin-left: -20px;">
                           
                         
                       <apex:image  width="150" height="75"/>
                       
                   </td>
                    <td width="40%" align="center" >
                     <b><span style="font-size: 20px;">Test Report </span></b><br/>
                     <b><span style="font-size: 16px;padding-left: 5px;">Test Report</span></b> 
                  </td> 
                  
                     <td width="20%" align="center">
                    <span >Created Date:</span> <br/>
                    <apex:outputText value="{0,date,dd'.'MM'.'yyyy}">
                            <apex:param value="{!today()}"/>
                            </apex:outputText><br/>
                            <span style="font-size: 16px;padding-left: 5px;">Version 1</span>
                                               
                         </td>
                
                    
                    
                    
                    
                    </tr> 
                 
            </table><br/>
            
               
            
            </div>
            <div style='mso-element:footer' id="f1" >
                               
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                                     <p class="MsoFooter">
                                        <tr>
                                            <td width="50%" word-spacing="5px">
                                                Constructed: SHEQ{!$User.FirstName} {!$User.LastName}<br/>
                                                VA 7.5.1 Steering documented information of conformity
                                            </td>
                                            <td align="center" width="20%">
                                           <apex:outputText value="{0,date,dd'.'MM'.'yyyy}">
                                            <apex:param value="{!Case.CreatedDate}"/>
                                            </apex:outputText>
                                            </td>
                                            <td align="center" width="30%">
                                                Page <span style='mso-field-code: PAGE '></span> of <span style='mso-field-code: NUMPAGES '></span>
                                                <br/>
                                                Print Date:<apex:outputText value="{0,date,dd'.'MM'.'yyyy}">
                                                <apex:param value="{!today()}"/>
                                                </apex:outputText>
                                            </td>
                                        </tr>
                                        </p>
                                    </table>
                                
                            </div>
                 
                          
        </body>
        
        </apex:form>
        
      
        </apex:page>
=================================================================
=====================sample output============================
User-added image
============================================================