I've been asked to create a VF page to dynamically create tables on a Preview Document for a Quote. I've created a section to reference the VF page. Using XSL:FO format, which is required from what I understand, the vf page renders nicely on the generated quote except for one thing. It doesn't respect the page breaks and will simply truncate tables from my vf page if they go over the end of the page. I need a way to make my vf page continue onto the next page.

<apex:page showHeader="false" sidebar="false" cache="false" contentType="text/xml" controller="TableController">
        <apex:repeat value="{!quoteLines}" var="key">
            <table table-layout="fixed" width="100%">
                <table-column column-width="100%"/>
                    <table-row font-size="10pt" text-align="center" color="white" font-weight="bold" background-color="#616590">
                        <table-cell font-weight="bold" padding="2pt" border=".06em solid black"><block>Services</block></table-cell>
                    <table-row font-size="10pt" text-align="center" color="#000000" font-weight="bold">
                        <table-cell font-weight="bold" padding="2pt" border=".06em solid black"><block>{!quoteLines[key].label} <apex:outputText value="{0, date, d MMMM yyyy}">
                            <apex:param value="{!quoteLines[key].startDate}" /></apex:outputText> - <apex:outputText value="{0, date, d MMMM yyyy}">
                                <apex:param value="{!quoteLines[key].endDate}" /></apex:outputText></block></table-cell>
        <apex:outputText rendered="{!quoteLines[key].quoteLines.size > 0}">  
            <table table-layout="fixed" width="100%">
                <table-column column-width="35%"/>
                <table-column column-width="40%"/>
                <table-column column-width="25%"/>
                    <table-row font-weight="bold" font-size="10pt" color="#000000">
                        <table-cell border=".06em solid black" padding="2pt" text-align="left"><block>QTY</block></table-cell>
                        <table-cell border=".06em solid black" padding="2pt" text-align="left"><block>Product Name</block></table-cell>
                        <table-cell border=".06em solid black" padding="2pt" text-align="right"><block>Amount</block></table-cell>
                    <apex:repeat value="{!quoteLines[key].quoteLines}" var="product">
                        <table-row font-size="10pt" text-align="left" color="#000000">
                            <table-cell padding="2pt" border=".06em solid black"><block>{!product.Quantity__c}</block></table-cell>
                            <table-cell padding="2pt" border=".06em solid black"><block>{!product.Name_Displayed__c}</block></table-cell>
                            <table-cell padding="2pt" border=".06em solid black" text-align="right">
                                <block><apex:outputText value="{0, number, ###,###,###,##0.00}"><apex:param value="{!product.Amount__c}" /></apex:outputText></block>
. . .

1 Answer 1


It was configuration - changed Keep Together from Always to Auto.


  • It's ok to answer your own questions (encouraged in fact) but please do mark it as the accepted answer, and also point out where to make said changes
    – Matt Lacey
    Oct 31, 2022 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .