• VIJAY SINGH
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

 

My knowledge on coding is very basic so I am not sure it is possble to do what I'd like or if I have to find an alternate solution.   Basically I am rendering a pdf which lists of of the delegates who have attended a training course and stating if they have passed or failed. 

 

I am doing this in a pdf attachment to an email.  I had it working fine until I found a course with 30+ delegates as the table just continues to render over the page footer and beyond.  Is there anyway to easily split this table after 30 entries (I would like to avoid anything creating controllers etc as they are over my head)?

 

This is my code (the red section is the data table):

 

<messaging:attachment renderAs="pdf"  filename="Exam results notification">
<html>
<head><style type="text/css" media="print">
body {color:#666666; font-family:"Arial Unicode MS"; font-size:11pt; font-style:normal; }

@page{
    @bottom-left {                  
    content: element(footer);      
    }   
    size: A4 portrait;
    margin-top:0cm;
    margin-left:0cm;
    margin-right:0cm;
    margin-bottom:0cm;  
}

div.footer {
   display: block;
   position: running(footer);
   line-height: 10pt;
   font-size: 7.5pt;
   color: #A9A9A9;
   z-index:2;                
}
   
</style>
</head>

<body>


<img src="{!URLFOR($Resource.Template)}" style="position: fixed; left: 0cm; top: 0cm;  z-index:-2;" width="21cm" height="29.7"/>

 <apex:dataTable cellpadding="2" width="15.92cm" border="0.2" style=" text-align:center; position: fixed; left: 2.54cm; top: 8cm; line-height: 12pt; font-size:11pt; z-index:+2;" columns="5" value="{!relatedTo.Enrollments__r}" var="cx" >

               <apex:column width="3cm"  >  
                   <apex:facet name="header">Number</apex:facet>
                       {!cx.name}       
               </apex:column>
               <apex:column >
                      <apex:facet name="header">姓名</apex:facet>
                             {!cx.delegate_name__r.LastNameLocal}{!cx.delegate_name__r.FirstNameLocal}
               </apex:column>
               <apex:column >
                      <apex:facet name="header">單位</apex:facet>
                          {!cx.delegate_name__r.department}     
               </apex:column>
               <apex:column >
                     <apex:facet name="header">英文姓名</apex:facet>
                         {!cx.delegate_name__r.LastName}{!cx.delegate_name__r.FirstName}
               </apex:column>
               <apex:column width="2cm" >
                   <apex:facet name="header">Pass/Fail</apex:facet>
                       {!IF(OR(CONTAINS(cx.Exam_results__c,'Fail'),CONTAINS(cx.Exam_results__c,'fail')),'F','P')}
               </apex:column>
               
        </apex:dataTable>



<table width="15.92cm" valign="top" style="position: fixed; left: 2.54cm; top: 27.1cm; line-height: 10pt; font-size:7.5pt; color: #A9A9A9;" >
  <colgroup>
    <col span="4" width="3.98cm" />
  </colgroup>
<tr valign="top">
<td>
address
</td>
<td>address</td>
<td></td>
<td></td>
</tr>
</table>
</body></html>
</messaging:attachment>

 

Many Thanks for any help you can offer.

 

  • December 19, 2012
  • Like
  • 0