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 

Render as PDF not working...works in HTML...please help!

Looking for suggestions...I have run out of ideas.  I have added 2 sections to my existing Visualforce page (problem code below). When testing in Sandbox, I ran into an issue with the second section...it was preventing me from rendering as PDF.  After breaking my brain for a few hours, I realized that field TR_Service_Group__c was not populated in any of the Opportunity Products that were being called on and once I ensured there was an TR_Service_Group__c with the value of "NQP", it worked fine.

I had to push into production before I could test further to make sure this issue would not come up further and of course, right away it didn't work.  Render as PDF is saying I need to check mark up to make sure it is valid.

I have ensured that both TR_Service_Group__c and Lease_Service_Group__c are populated in all products so that can't be the issue.  I've done some research and so have also checked by removing the "Render as PDF" and it worked fine in HTML.  I played around with API versions, but I was already on 41 and now 43 and all research said above 28 should be fine in posts about this issue.  I've checked security on the fields since they are new and they are visible and editable.

Any troubleshooting suggestions appreciated!!

Here are the sections that are causing the problem (through process of elimination...without these sections of code, the PDF works).  I think the mark up is fine because I had it working in Sandbox...
 
<apex:dataTable value="{!Opportunity.opportunityLineItems}" var="OP" style="width:98.7%">
                            <apex:column rendered="{!OP.Lease_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.Lease_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.Lease_Service_Group__c = 'NQP' && Opportunity.Language__c = 'FRENCH'}"></apex:column>
                            <apex:column rendered="{!OP.Lease_Service_Group__c = 'NQP'}" headerValue="{!lblSubTot}" value="{!OP.Lease_NQP__c}" 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%">
                            <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="{!lblSubTot}" value="{!OP.TotalPrice}" headerClass="column_ttl tac" styleClass="tbl_bdr tar" style="width:15%;"></apex:column>
                        </apex:dataTable>