0

I am getting an error like PDF generation failed for render in a tab panel. I need to do conditionally show the tab panel. Can some suggest a way out. Please find the snippet from my page here.

 <apex:tabPanel >
       <apex:tab label="HCP Calls" rendered="{!IF(oIncTranListHCPDetail.size>0, true, false)}">

        <apex:pageBlockTable columns="9" value="{!oIncTranListHCPDetail}" border="true" var="itr" cellPadding="4" >
        <apex:column headerValue="Professional Name" style="background-color:#FFFFFF;" value="{!itr.Prof_First_Name_abv__c} {!itr.Prof_Middle_Name_abv__c} {!itr.Prof_Last_Name_abv__c}" />

         <!-- Need to put Profname string here from the map -->
        <apex:column headerValue=" ABS on Call" style="background-color:#FFFFFF;"/>
        <apex:column value="{!itr.Account_Abs_abv__c}" style="background-color:#FFFFFF;"/> 
        <apex:column headerValue=" Professional Address" style="background-color:#FFFFFF;"/>
        <apex:column value="{!itr.Prof_Address_Line1_abv__c}" style="background-color:#FFFFFF;"/> 
        <apex:column headerValue=" Associated Prescriber" value="{!itr.Associated_Prescriber_ID_abv__c}" style="background-color:#FFFFFF;"/>
        <apex:column headerValue=" Product" value="{!itr.Account_Abs_abv__c}" style="background-color:#FFFFFF;"/>
        <apex:column headerValue=" Activity Date" value="{!itr.Account_Abs_abv__c}" style="background-color:#FFFFFF;"/> 
        <apex:column headerValue=" Outcome - LOV" value="{!itr.Outcome_abv__c}" style="background-color:#FFFFFF;"/>



        </apex:pageBlockTable>
        </apex:tab>
        </apex:tabPanel>

Also I find in an apex PDF page Tabpanel rendered="false" fails to execute the whole pdf page.

1

This Best Practices for Rendering PDFs documentation lists apex:tabPanel in the "Components That Are Unsafe to Use in a PDF" section and possibly you are seeing why...

The approach I have taken with PDF output is to create separate Visualforce pages that use mainly HTML tags and CSS styling that is appropriate for printed pages and just the apex tags that are in the "Components That Are Safe to Use in a PDF" section of the linked document. At first this seems like a lot of extra work, but in practice it allows each page to be optimised for its specific use.

(Its also worth developing the PDF pages with renderAs="HTML" so you can use normal browser debug features to develop them and then switch to renderAs="PDF" at the end.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.