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
Will EdwardsWill Edwards 

How does one display the column header value at the top of all pages when rendered as PDF?

Using pageBlockTable, I'd like to show a long list of Members (contacts) with various Renewal statuses. I'd like the column header to appear on all pages. Is this possible?
<apex:pageBlockTable value="{!FinalConList}" var="con">
    <apex:column headerValue="Renewal" headerClass="headerStyle"
        value="{!con.CV_Impact_Status__c}" />
    <apex:column headerValue="Member" headerClass="headerStyle" 
        value="{!con.FirstName} {!con.LastName} - {!con.Account.Company_Nickname__c}" />   
You may be able to do this with CSS selectors [1].  It might be a little tough.  I'll try to look into it for you, but I don't know how long it'll take.

So, this doesn't look like it's really possible.  In theory, this should automatically do it when using THEAD [1] (which Salesforce does with apex:pageBlockTable).  However I am unable to get this to work.  My guess is that it's because Salesforce is generating this as a PDF with some other sort of rendering engine that does not honor the THEAD spec.  I tried a bunch of different options but because you cannot execute JavaScript against a renderAs="pdf" Visualforce page, there is nothing that you can do.  Your only other option would be to know how many rows are rendered on a specific page and split your FinalConList into that number of parts and use apex:repeat to make n number of tables to cover the list.

You could use CSS in the <Head> to set the header and footer elements.  But I'm not sure how to make it (the page break) happen automatically. You could also do a counter in the pageblock table, and in the repeat, do a <div style="page-break-after:always;" />  
			<style type="text/css" media="print">
				@page { margin: .25in .25in .5in .25in;
						@top-left {content :element(header);}
						@bottom-left {content :element(footer);}
				div.header {position: running(header); }
				div.footer {position: running(footer);}
				div.footerLarge {}
				div.RLColor {color:#6887AF;}
				div.REColor {color:#8AB043;}