Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am generating a pdf which group accounts first by Country and then by property.

For this i have used nested repeat tag.I want a page break for every country i.e. a page break for every outer repeat tag.

Please advice.

<apex:page controller="AccountSummaryReportController" action="{!loadKeyAccounts}" renderAs="pdf" >

    <apex:sectionHeader title="Account Summary Report as of : {!TODAY()}"  description="This Report Shows Accounts modified in last 31 days"/>
    <apex:form >
        <apex:pageBlock >
            <apex:repeat value="{!objectMap }" var="ProgNameKey">
                <apex:pageBlock title="{!ProgNameKey}" >
                    <apex:repeat value="{!objectMap [ProgNameKey]}" var="PlanNameKey">
                        <apex:outputPanel styleClass="grey" layout="block">
                            <apex:pageBlockSection title="{!PlanNameKey}" columns="1" >
                                <apex:pageBlockTable value="{!objectMap [ProgNameKey][PlanNameKey]}" var="lstGrnRate"  border="1" columnsWidth="20%,5%,75%" >
                                    <apex:column value="{!lstGrnRate.Account__r.Name}"/>
                                    <apex:column footerClass="reviewStatusHeader" HeaderValue="Summary Status" headerClass="centHeader">
                                       <apex:image value="{! If(lstGrnRate.Status__c=="Red" ,URLFOR($Resource.Red),
                                                      If(lstGrnRate.Status__c=="Green",URLFOR($Resource.Green), URLFOR($Resource.Amber))) }" width="40" height="30" style="float:centre;"/>
                                     </apex:column>
                                    <apex:column value="{!lstGrnRate.Account_Summary__c}"/>
                                </apex:pageBlockTable>
                            </apex:pageBlocksection>
                        </apex:outputPanel>
                    </apex:repeat>
                </apex:pageBlock>
            </apex:repeat>
        </apex:pageBlock>
    </apex:form>
</apex:page>
share|improve this question

Use

page-break-after: always;

Css to break the page in PDF

            </apex:repeat>
      </apex:pageBlock>
  <p style="page-break-after: always;" ></p>
</apex:repeat>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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