function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
prazonprazon 

Problem in CSS rendering as PDF

Hi,

 

I have a visualforce component  which is not taking in any CSS. Previously it was working fine but now suddenly it is not taking any CSS defined, cannot really get the problem, help is needed, Here I am posting the code:

 

<messaging:emailTemplate subject="Go Live on Groupon – Welcome Back!" recipientType="Contact" relatedToType="Schaltungsobjekt__c">
<messaging:htmlEmailBody >
<c:ETContractReFeatureGoLive1 SchaltungsobjektId="{!relatedTo.Id}"/>
 

</messaging:htmlEmailBody>
<messaging:attachment renderAs="PDF" filename="Deal Sheet.pdf">

       <c:ETContractGoLIve2 SchaltungsobjektId="{!relatedTo.Id}"/>

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

 and the component:

 

<apex:component controller="ETContractController"  access="global">
<apex:attribute name="SchaltungsobjektId" description="The Schaltungsobjekt Id" type="String" assignTo="{!SchaltungsobjektId}"/>
<html>
<head>
<style type="text/css">

.head_text{
    font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #000;
    text-decoration: none;
    font-weight:bold;
      }
.content_text{
    text-decoration: none;
    clear:both;
    font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #000;
    
      }
.content_text1{
      font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #ff0022;
    text-decoration: none;
      }
.content_text_border{
     font-style: arial;
    font-family: arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #000;
    text-decoration: none;
    border:#000000 solid 1px;
    align: left
      }

</style>
</head>

<table width="603" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top"><!--<div align="justify">-->
      <table width="100%" border="0" cellspacing="0" cellpadding="0">

        <tr>
          <td width="603" align="left" valign="top"><apex:image id="theImage" value="{!$Resource.ET_Header}" width="603" height="118"/></td>
        </tr>
        <tr>
          <td align="left" valign="top">
          <br /><span class="content_text"><strong>
               Deal sheet for contract number: {!Schaltungsobjekt.Vertrag__r.ContractNumber}</strong><br />
                <strong>Partner: {!Schaltungsobjekt.Account__r.Name}</strong><br />
                <strong>Going Live date:  {!StartDate}</strong></span><br /> 
              <br />
              <!--<span class="content_text"><strong><u>DEAL REFERENCE:</u></strong><strong><u>{!CDA.CDA_Number__c}</u></strong></span><br />
              <br />-->
          <div align="justify"> 
              <apex:dataTable value="{!CDAs}" styleClass="content_text_border" var="cont" border="1" cellpadding="1px">
        <apex:column >
            <apex:facet name="header">Deal Headline</apex:facet>
            <apex:outputfield value="{!cont.Deal_Headline__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Deal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>Reference</apex:facet>
            <apex:outputfield value="{!cont.CDA_Number__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Estimated voucher sales*</apex:facet>
            <apex:outputfield value="{!cont.Confirmed_Cap__c}" />
        </apex:column>
        <apex:column >  
            <apex:facet name="header">Original Price</apex:facet>
            <apex:outputfield value="{!cont.Orginal_Price__c}" />
        </apex:column>
            <apex:column >
            <apex:facet name="header">Discount</apex:facet>
            <apex:outputfield value="{!cont.Discount__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Groupon Price</apex:facet>
            <apex:outputfield value="{!cont.Groupon_Price__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">Success Fee</apex:facet>
            <apex:outputfield value="{!cont.Commission__c}" />
        </apex:column>
        <apex:column >
            <apex:facet name="header">VAT <br/> payable <br/>on&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/> Success Fee</apex:facet>
            <apex:outputfield value="{!cont.VAT__c}" />
            
        </apex:column>
        <apex:column >
            <apex:facet name="header">Payout <br/>to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/> Partner</apex:facet>
            <span style="font-weight:bold;"><apex:outputfield value="{!cont.Groupon_payout_per_voucher__c}" /></span>
        </apex:column>        
</table>
      <!--</div>--></td>
  </tr>
</table>

</html>
</apex:component>

 

igor@vfdev.sfdcigor@vfdev.sfdc

This should have been fixed by now. Is your your template working as expected?

 

As a side note, it is not a good idea to use inline <style>, especially in a component (which can be rendered more than once on a single page). A safer way is to have your styles in a static resource file linked via <apex:stylesheet>

prazonprazon

Problem solved..it came due to summer release version mismatch