• valeria jasarevic
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
I have a Visualforce PDF quote that is taking informaiton from a field.  However it is not implementing the breaks or next line formatting.  I basically get a run on sentence which is confusing. (the field is !line.Description__c)  Here is the code that controlls this particular field.

<tr>
           <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line"> <tr>
            <td colspan="1"> <font face="Arial">{!line.Quantity}</font></td>
           <td colspan="2"> <font face="Arial">{!line.PricebookEntry.ProductCode}</font></td>
           <td colspan="6"> <font face="Arial" align="left" > {!line.Description__c} </font></td>
           </tr>
<tr>
          <td colspan="1" bgcolor="#fafafa"> </td>
          <td colspan="1" bgcolor="#fafafa"> </td>
          <td colspan="6" bgcolor="#fafafa"> </td>
          <td colspan="1" bgcolor="#fafafa"> </td>
          <td colspan="1" bgcolor="#fafafa"> </td>
</tr>
</apex:repeat> 
 
First time doing my own Visual Force Email Template.  I thought I had it all and then this message shows up:


Error occurred trying to load the template for preview: PDF generation failed. Check the page markup is valid.. Please try editing your markup to correct the problem.

Here is what my template looks like

<messaging:emailTemplate subject="Packaging Request from {!$User.FirstName} " recipientType="Contact" relatedToType="Opportunity">
<messaging:plainTextEmailBody >
{!recipient.name},
        
        We have a packaging request for {!$Organization.Name}.  Please find attached the PDF with all the relevant information
        
        
        
        
        Regards,
        {!$User.FirstName} {!$User.LastName}
        <br/>
</messaging:plainTextEmailBody>

   <messaging:attachment renderAs="pdf" filename="{!relatedTo.name}">              
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
    <td>
        <img src='{!URLFOR($Resource.LOGO)}' title="logo" />
    </td>
    <td  align="right"><font face="Arial" >
    <b>Packaging Word Order for {!relatedTo.Account.Name}</b></font><br/>
    </td>
    
    
</tr>

<hr/>

</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>    <td><font face="Arial" >
        {!$Organization.Name}<br/>
        {!$Organization.Street}<br/>
        {!$Organization.PostalCode} {!$Organization.City}<br/>
        {!$Organization.Country}<br/>
        </font></td> 
        <td width="60%">&nbsp;</td>
   <td ><font face="Arial">Ship Date: {!relatedTo.CloseDate} <br/>
        <br/>
        Requested by: <br/>
{!relatedTo.Owner.LastName} {!relatedTo.Owner.FirstName}</font>
     </td>
</tr>
</table>
<br/>
<hr/>
<p><b><font face="Arial" color="#000080">Customer Information</font></b></p>

<table border="0" width="100%" id="table2">
<tr>
       <td colspan="3">
           <font face="Arial">Account name: {!relatedTo.Account.Name} <br/><br/></font>
       </td>
</tr>
<tr>
       <td>          
           <font face="Arial">Bill To:<br/>
                             {!relatedTo.Account.BillingStreet}<br/>
                             {!relatedTo.Account.BillingPostalCode} {!relatedTo.Account.BillingCity}
           </font>
        </td>
        <td width="50%"></td>
        <td >
           <font face="Arial">Ship To:<br/>
                              {!relatedTo.Account.ShippingStreet}<br/>
                              {!relatedTo.Account.ShippingPostalCode} {!relatedTo.Account.ShippingCity}
           </font>
        </td>
</tr>    
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Products</font></b></p>
<table border="0" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">Product</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Image</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Quantity</font></td>
</tr>
<tr>
       <apex:repeat value="{!relatedTo.OpportunityLineItems}" var="line">
          <tr>
             <td>{!line.PricebookEntry.Name}</td>
             <td ALIGN="center"><img src='{!line.PricebookEntry.Product2.URL_Picture__c}'/></td>             
             <td>{!line.Quantity}</td>
                       </tr>
       </apex:repeat>  
</tr>
<tr>
</tr>
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Custom Conditions</font></b></p>
<table border="0" width="100%" id="table3">
<tr>
        <td><font face="Arial">
        
              <b>Packaging Notes {!relatedTo.Packaging_Notes__c}</b></font><br/>
          
        </td>
        </tr>
        </table>
<p align="center"><font face="Arial"><i>Copyright {!$Organization.Name}.</i></font></p>

    </messaging:attachment>  
</messaging:emailTemplate>




Does anyone know how to correct this??