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
Heather_HansonHeather_Hanson 

Visualforce PDF generation failed. Check the page markup is valid.

I think I know WHY I'm getting the error, but still haven't solved it.

I have a visualforce page that renders as PDF.  It is a receipt for returned hardware.  We have a Hardware custom object and my VF page has a conditional rendering to only show the Hardware Product Name and Serial number originally, if the "Client_Returned_Date__c" = TODAY. 

We then got the error message above for one account and I realized it is probably because some records may have nothing populated in the "Client_Returned_Date__c" field so I created a Date Formula field that says: IF(Client_Returned_Date__c = TODAY(), Client_Returned_Date__c, DATE(2000,01,01) ). It means the person would have to update all previous hardware, but there is not many so it isn't that much and going forward the field will always be populated so it won't always be an issue.

So I updated my VF page conditional rendering to use this new formula field instead and tested.  My formula field works as expected, but I still get the error message above (even though there is now a value for each record for this formula field.  I also checked the other fields indicated (Product name and Serial number) and there are values in all.

Any suggestions what I'm overlooking?

Here is the VF page if it helps!:
 
<apex:page standardController="Account" applyHtmlTag="true" showHeader="false" renderAs="PDF">

<apex:stylesheet value="{!$Resource.AssetReceipt_PDF}"/>
<apex:stylesheet value="http://fonts.googleapis.com/css?family=Open+Sans"/>



      
    <table cellspacing="0" border="0" cellpadding="0" width="98%">  
        <tr>
            <td width="80%" valign="top"><apex:image id="logo" url="{!$Resource.logo_bkp}"/> </td>
            <td width="18%">               
                <table id="servicetbl" cellspacing="0" border="0" cellpadding="5">
                    <tr><td colpsan="3"></td></tr>     
                    <tr>
                    <td class="rt" width="20%">Date:&nbsp;<apex:outputText value="{0,date,yyyy-MM-dd 'Time:' hh:mm}"> <apex:param value="{!NOW () - 0.208333}" /></apex:outputText></td>                    
                    </tr>
                </table>
            </td>
        </tr>
    </table>   
    
    <br clear="all" />
    <div class="full_line">{!Account.Name}</div><br clear="all"/>
    <div class="full_line">{!Account.AccountNumber}</div><br clear="all"/>

    <div >
        <br/>
        <br/>
        <h2>ÉQUIPEMENT RETOURNÉ</h2><br clear="all"/>
        <apex:dataTable value="{!Account.Hardware__r}" var="AH" columns="6" cellPadding="0" border="1" width="100%"  headerclass="Mheader_sm" title="Returned Equipment">
            
            <apex:column headerValue="PRODUCT NAME" rendered="{!IF(AH.Client_Returned_Date_VF__c = TODAY(),true,false)}" value="{!AH.Product_Txt__c}" styleClass="tbl_bdr" /> 
            <apex:column headerValue="SERIAL #" rendered="{!IF(AH.Client_Returned_Date_VF__c = TODAY(),true,false)}" value="{!AH.Serial_Number__c}"  styleClass="tbl_bdr"/>

        </apex:dataTable>
    </div>    
   
    <div class="full_line">
        
    <table>
    <tr>
    <td style="border-bottom:1px solid #000000; height:75px; width:40%;"></td>
    </tr>  
    <tr>
    <td>Heather Hanson</td>
    </tr>
    </table>
    </div>
    
        <div class="footerC">
            <div class="cover_footer">My company info</div>    
        </div>
           
 
 </apex:page>

 
Heather_HansonHeather_Hanson
Just a follow up on my post, I have removed the render PDF and the form works fine.  I've taken apart my page piece by piece and it is definitely the data table that is causing the problem.   I changed my 'columns="6"' to 2 since that is all I have and the issue still occurs.  My formula fields seem to be working as they should so I can't figure out where my issue is.  
Melissa Jones 11Melissa Jones 11
I think the problem is with using inline CSS as per this link. If you use inline CSS styles, set the API version to 28.0 or later bluestacks (https://www.bluestacks.onl/
Heather_HansonHeather_Hanson
Hi Melissa,

Thanks for getting back to me.  My API is version 44.0 so I'm good there and I removed this portion of inline CSS (    <td style="border-bottom:1px solid #000000; height:75px; width:40%;"></td>)  and the issue still persists.  If you can offer any other suggestions that would be appreciated!!