Skip to main content
John Neff (Ring2Media) ha fatto una domanda in #Visualforce
Hello, 

I have an email template and corresponding PDF attachment, and would like to create a page break after each table, is there a logical way to do this?   Here is the attachment: 

 

<messaging:attachment renderAs="PDF" filename="netorder.pdf">

<html>

<head>

<style>

@page{

size: A4 landscape;

}

</style>

</head>

<body style="font-family: 'Trebuchet MS'">

<div align="center">

<img src="{!$Resource.CashR2MLogo}" /> <br/>

</div>

<h2>ORDER/TRAFFIC INSTRUCTIONS</h2>

<apex:repeat value="{!relatedTo.Post_Logs__r}" var="buyline">

<apex:outputPanel rendered="{!IF(buyline.Broadcast_Week__c = relatedTo.Send_Request__c, true, false)}">

//PAGE BREAK WOULD GO HERE, SO THAT EACH Buy_Title_c AND CORRESPONDING TABLE WOULD BE ON ITS OWN PAGE//

<p>{!buyline.Buy_Title__c}</p>

<table cellpadding="5" style="border-collapse: collapse" width="860" border="1">

<tr>

<td style="background-color: ⌗D8D8D8; color: ⌗190707" width="85"><b>DAYS</b></td>

<td style="background-color: ⌗D8D8D8; color: ⌗190707" width="175"><b>TIME</b></td>

<td style="background-color: ⌗D8D8D8; color: ⌗190707" width="100"><b>⌗ OF SPOTS</b></td>

<td style="background-color: ⌗D8D8D8; color: ⌗190707" width="100"><b>800⌗ </b></td>

<td style="background-color: ⌗D8D8D8; color: ⌗190707" width="100"><b>ISCI</b></td>

<td style="background-color: ⌗D8D8D8; color: ⌗190707" width="100"><b>GROSS COST PER UNIT</b></td>

<td style="background-color: ⌗D8D8D8; color: ⌗190707" width="100"><b>⌗ OF WEEKS</b></td>

<td style="background-color: ⌗D8D8D8; color: ⌗190707" width="100"><b>TOTAL</b></td>

</tr>

</table>

<apex:repeat value="{!relatedTo.Daypart__r}" var="days">

<apex:outputPanel rendered="{!IF(days.Media_Buy__c = buyline.Id, true, false)}">

<table cellpadding="5" style="border-collapse: collapse" width="860" border="1">

<tr>

<td width="85">

{!days.Days__c}

</td>

<td width="175">

{!days.Frame__c}

</td>

<td width="100">

{!TEXT(days.Weekly_Units__c)}

</td>

<td width="100">

{!days.DNIS__c}

</td>

<td width="100">

{!days.ISCI__c}

</td>

<td width="100">

${!days.Gross_Rate__c}0

</td>

<td width="100">

1

</td>

<td width="100">

${!days.Gross_Weekly_Total__c}0

</td>

</tr>

</table>

</apex:outputPanel>

</apex:repeat>

</apex:outputPanel>

</apex:repeat>

</body>

</html>

</messaging:attachment>

Thanks in advance!
4 risposte
  1. 28 ott 2015, 21:07
    So a little bit of dumb luck goes a long way, I wrapped my output panel in a DIV and then gave that DIV a style="page-break-after: always"> attribute and it did the trick!

    I thought that I would post an update here in case anyone searched this thread!
0/9000