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
Edwards71Edwards71 

Visualforce PageblockTable headings not repeated if more than one page

Hi,

 

I'm sure there is an easy answer to this but I have tried most things I can think of!

 

I'm using PageBlockTable to iterate over a list of data which is being rendered to PDF.

 

If the list pushes the data onto more than one page the column headers are not repeated.  how can I get the column headers to repeat on each new page?

 

Thanks in advance!

AnushaAnusha

Hi, use list<list<>> in page

 

if you are using list<Account> in page now, then use list<list<Account>>

 

in page.

 

<apex:repeat value="{!ListOfList}" var="list">

<apex:PageBlockTable value="{!list}" var="item">


</apex:PageBlockTable>

</apex:repeat>

Edwards71Edwards71

Hi,

 

Thanks, but this seems to put column headers after every row rather than repeating at the top of every new page.

 

 

Is there a way to just get column headers repeated at the top of every page or do I need to use a more complex example in the Cookbook that uses apex to work out where page breaks will be?

 

Thanks

 

AnushaAnusha

add this on end of innter repeate

 

<div style="page-break-after: always;"></div>

 

this will allow you to break the page