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
Brad BothBrad Both 

Dynamic Page Breaks within pageblockTable

I am in desperate need of help and everything I find on this doesn't help what I'm attempting to do. Let's start with the basics. I'm creating a "Program Report" document, all the content on the document is being populated by several different objects within my Program object. The document begins with a general overview and description and ends with disclaimers. Outside of the disclaimers at the bottom, the rest of the information is called from the Program Object and it's children. 

Some things to note, I'm primarily using pageblockTables to display the data and my local css sheet to style it the way it is needed. Every table I have does not display the headers at all and they are completely hidden. So instead of headers I am using custom images. The reason for this is that we want to maintain a design flow and because a customer will get this report we need it to fall in line with the design of the rest of what we are creating. The biggest issue is being that rendering a pdf only allows four fonts and we have a specific one that we need to use for our headers and subheaders. Now, everything looks good but there is a small issue. 

Between that top and bottom is 3 different subsections. Each has a list of parameters which have a variable attached to them as well as a description. Two of these are displayed the same where in the first row is two columnes, one with the name the other with the variable. The next row that spans both colums has the description. The third looks a little different but same principal. Names and Variables span across 4 columns and in the next row has two Descriptions one spanning one column the other spanning two columns. 

And here inlies the issue. when I'm going from page to page the table just continues to the next page without any breaks. I will try and find links to the things I have already tried which has included the css style page-break-after:always. The issue with this is it's not page breaking within the table but after the table so the issue of the table spilling into the next page and leaving some content on one page and the related description is on another. Or the description will get cut in half. This can't happen.

The other fix that was mentioned was something I believed is refered to as pagination, again this seems like a great idea but it also requires a limi as to the number of entries per page which forces you to tweak numbers until you find the right balance. The problem with this is my initial decription can be two sentences or two paragraphs. This immediately changes where all my subheaders start. Because I'm creating dynamically it's impossible for me to know just how many items will be displayed on any given page. 

I can take some screenshots and copy code if necessary but as it stands I don't have any code in here many an attempts to fix the page breaking issue. Thanks for any and all help