You need to sign in to do that
Don't have an account?
VisualForce <apex:repeat>
Hi there,
this is a snippet from a page renderas="pdf"
<apex:repeat value="{!ResultsPos}" var="field2">
<!--style="page-break-before:always;"-->
<!--page-break-inside:inherit;-->
<tr>
<td><apex:outputField value="{!field2.Bezeichnung__c}" styleClass="myfontBrief"/></td>
<td align="right"><apex:outputField value="{!field2.Anzahl__c}" styleClass="myfontBrief"/></td>
<td align="right"><apex:outputField value="{!field2.Einzelpreis__c}" styleClass="myfontBrief"/></td>
<td align="right"><apex:outputField value="{!field2.Summe__c}" styleClass="myfontBrief"/></td>
</tr>
</apex:repeat>
public List<FakturaPosition__c> getResultsPos()
{
List<FakturaPosition__c> outResultsDetail = new List<FakturaPosition__c>();outResultsDetail = [select Anzahl__c,Einzelpreis__c,Summe__c,Bezeichnung__c,Faktura__r.Vertrag__c from FakturaPosition__c where Faktura__c = : ApexPages.currentPage().getParameters().get('id')];
//outResults.add(outResultsDetail);
return outResultsDetail;
}
It is possible to get a loop number from the repeater because this content into this repeater is much bigger for on PDF site and i would like
make a custom page-break. For example: <div style="display:{!IF (counter = 15 , 'block','none')}; page-break-before:always;"></div>
Thanks very much
Steve
I have create a workaround with a new class "FakturaPositionen" in my extension class.
Now I receivd the index from the row and I can make a custom page-break.
{
List<FakturaPosition__c> outResultsDetail =[select Anzahl__c,Einzelpreis__c,Summe__c,Bezeichnung__c,Faktura__r.Vertrag__c
from FakturaPosition__c where Faktura__c = : ApexPages.currentPage().getParameters().get('id')];Integer index = 0;
for (FakturaPosition__c fp : outResultsDetail){
fplist.add(new FakturaPositionen(index++, fp));}
return fplist;}
{
public Integer index {get; set;} public FakturaPosition__c pos {get; set;}{
index = i;
pos = fp;
}
}
VF Page
<apex:repeat value="{!ResultsPos}" var="field2">
<!--style="page-break-before:always;"-->
<!--page-break-inside:inherit;-->
<tr>
<td valign="top"><apex:outputField value="{!field2.pos.Bezeichnung__c}" styleClass="myfontBrief"/></td>
<td valign="top" align="right"><apex:outputField value="{!field2.pos.Anzahl__c}" styleClass="myfontBrief"/></td>
<td valign="top" align="right"><apex:outputField value="{!field2.pos.Einzelpreis__c}" styleClass="myfontBrief"/></td>
<td valign="top" align="right"><apex:outputField value="{!field2.pos.Summe__c}" styleClass="myfontBrief"/></td>
<td valign="top" style="display:{!IF(field2.index = 25,'block','none')};page-break-before:always;"></td>
</tr>
</apex:repeat>