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 

PDF generation failed. Check the page markup is valid. Issue with datatable and columns tags

When rendering a visualforce page as PDF, I'm running into the error above often and have been unable to figure out what the error is. 

Through process of elimination, I have been able to narrow down the problem sections to my use of the datatable and columns tags, but can't figure out what the cause of the problem is.  I read in the developer notes that you have to use datatable with caution and if a column is blank that could be the error, but I'm not sure if that is my problem.  If anyone can take a look at my code and suggest any fixes, that would be great!

Below are the datatables that are causing the error message to fire:
 
<apex:dataTable value="{!Opportunity.opportunityLineItems}" var="OP" style="width:98.7%; border:1.5px solid #d9d9d9; border-bottom: 0px !important;">
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'NQP'}" headerValue="TR Code" headerClass="column_ttl tac" styleClass="tbl_bdr tac" style="width:10%;"><apex:outputText value="{!OP.TR_Service_Group__c}"/></apex:column>
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'NQP'}" headerValue="{!lblQty}" headerClass="column_ttl tac" styleClass="tbl_bdr tac" style="width:5%;"><apex:outputText value="{0, number,###,###,##0}"><apex:param value="{!OP.Quantity}" /></apex:outputText></apex:column>
                            <apex:column headerValue="Description" value="{!OP.PriceBookEntry.Name}" headerClass="column_ttl" styleClass="tbl_bdr" rendered="{!OP.TR_Service_Group__c = 'NQP' && Opportunity.Language__c = 'ENGLISH'}"></apex:column>
                            <apex:column headerValue="Description" value="{!OP.Product2.Product_name_french__c}" headerClass="column_ttl" styleClass="tbl_bdr" rendered="{!OP.TR_Service_Group__c = 'NQP' && Opportunity.Language__c = 'FRENCH'}"></apex:column>
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'NQP'}" headerValue="Regular Price" value="{!OP.ListPrice}" headerClass="column_ttl tac" styleClass="tbl_bdr tar" style="width:15%;"></apex:column>
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'NQP'}" headerValue="Sold Price" value="{!OP.UnitPrice}" headerClass="column_ttl tac" styleClass="tbl_bdr tar" style="width:15%;"></apex:column>
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'NQP'}" headerValue="{!lblSubTot}" value="{!OP.TotalPrice}" headerClass="column_ttl tac" styleClass="tbl_bdr tar" style="width:15%;"></apex:column>
                        </apex:dataTable>          
    
                        <apex:dataTable value="{!Opportunity.opportunityLineItems}" var="OP" style="width:98.7%; border:1.5px solid #d9d9d9; border-top: 0px !important;">
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'CNT'}" headerValue="TR Code" headerClass="column_ttl tac" styleClass="tbl_bdr tac" style="width:10%;"><apex:outputText value="{!OP.TR_Service_Group__c}"/></apex:column>
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'CNT'}" headerValue="{!lblQty}" headerClass="column_ttl tac" styleClass="tbl_bdr tac" style="width:5%;"><apex:outputText value="{0, number,###,###,##0}"><apex:param value="{!OP.Quantity}" /></apex:outputText></apex:column>
                            <apex:column headerValue="Description" value="{!OP.PriceBookEntry.Name}" headerClass="column_ttl" styleClass="tbl_bdr" rendered="{!OP.TR_Service_Group__c = 'CNT' && Opportunity.Language__c = 'ENGLISH'}"></apex:column>
                            <apex:column headerValue="Description" value="{!OP.Product2.Product_name_french__c}" headerClass="column_ttl" styleClass="tbl_bdr" rendered="{!OP.TR_Service_Group__c = 'CNT' && Opportunity.Language__c = 'FRENCH'}"></apex:column>
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'CNT'}" headerValue="Regular Price" value="{!OP.ListPrice}" headerClass="column_ttl tac" styleClass="tbl_bdr tar" style="width:15%;"></apex:column>
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'CNT'}" headerValue="Sold Price" value="{!OP.UnitPrice}" headerClass="column_ttl tac" styleClass="tbl_bdr tar" style="width:15%;"></apex:column>
                            <apex:column rendered="{!OP.TR_Service_Group__c = 'CNT'}" headerValue="{!lblSubTot}" value="{!OP.TotalPrice}" headerClass="column_ttl tac" styleClass="tbl_bdr tar" style="width:15%;"></apex:column>
                        </apex:dataTable> 
    
                        <apex:outputPanel rendered="{!CONTAINS(strServiceType, 'PREPAID') && CONTAINS(Opportunity.Financing_Term__c, '36')}">    
                            <apex:dataTable value="{!Opportunity}" var="OPP" headerClass="hidden" style="width:98.7%; border: 1.5px solid #d9d9d9; border-top: 0px !important; border-bottom: 0px !important;">
                                <apex:column styleClass="tbl_bdr tac" style="width:10%;"><apex:outputText >HPX+HPS</apex:outputText></apex:column>
                                <apex:column styleClass="tbl_bdr tac" style="width:5%;"><apex:outputText value="{0, number,###,###,##0}"><apex:param value="{!OPP.TR_Prepaid_Unifon_Services_Qty__c}" /></apex:outputText></apex:column>
                                <apex:column styleClass="tbl_bdr tal" ><apex:outputText >Prepaid Services</apex:outputText></apex:column>
                                <apex:column styleClass="tbl_bdr tar" style="width:15%;" value="{!OPP.TR_Prepaid_Unif_n_Service_36__c}"/>  
                                <apex:column styleClass="tbl_bdr tar" style="width:15%;" value="{!OPP.TR_Prepaid_Unif_n_Service_36__c}"/>  
                                <apex:column styleClass="tbl_bdr tar" style="width:15%;" value="{!OPP.TR_Prepaid_Unif_n_Service_36__c}"/>  
                            </apex:dataTable>
                        </apex:outputPanel>

                        <apex:outputPanel rendered="{!CONTAINS(strServiceType, 'PREPAID') && CONTAINS(Opportunity.Financing_Term__c, '60')}">    
                            <apex:dataTable value="{!Opportunity}" var="OPP" headerClass="hidden" style="width:98.7%; border: 1.5px solid #d9d9d9; border-top: 0px !important; border-bottom: 0px !important;">
                                <apex:column styleClass="tbl_bdr tac" style="width:10%;"><apex:outputText >HPX+HPS</apex:outputText></apex:column>
                                <apex:column styleClass="tbl_bdr tac" style="width:5%;"><apex:outputText value="{0, number,###,###,##0}"><apex:param value="{!OPP.TR_Prepaid_Unifon_Services_Qty__c}" /></apex:outputText></apex:column>
                                <apex:column styleClass="tbl_bdr tal" ><apex:outputText >Prepaid Services</apex:outputText></apex:column>
                                <apex:column styleClass="tbl_bdr tar" style="width:15%;" value="{!OPP.TR_Prepaid_Unif_n_Service_60__c}"/>  
                                <apex:column styleClass="tbl_bdr tar" style="width:15%;" value="{!OPP.TR_Prepaid_Unif_n_Service_60__c}"/>  
                                <apex:column styleClass="tbl_bdr tar" style="width:15%;" value="{!OPP.TR_Prepaid_Unif_n_Service_60__c}"/>  
                            </apex:dataTable>
                        </apex:outputPanel>