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
shakila Gshakila G 

how to stop a repeat based on first repeat row value?

I want to Muliple list field value into  another list field Value after displaying into the VF 
page.

But my Vf repaet page Working Wrong kindly Help m eon this

VF Page

<apex:page renderAs="PDF" standardController="Project__c" extensions="Dispatch_Workorder_Checklist" applyBodyTag="False" ShowHeader="False"  applyHtmlTag="False">
    <html>
      <head>
        <style>
            @page {
                
                margin-top: 4cm;
                margin-bottom: 2cm;
                margin-right:1CM;
                 margin-Left:1CM;
                  padding: 5px;
                  
                @top-center {
                    content: element(header);
                }
                @bottom-left {
                    content: element(footer);
                }
            }
    
            div.header {
                width: 100%;
                padding: 5px;
                position: running(header);
            }
            div.footer {
                display: block;
                padding: 5px;
                position: running(footer);
            }
            .pagenumber:before {
                content: counter(page);
            }
            .pagecount:before {
                content: counter(pages);
            }
            div.content {
                 border: 1px solid black;
                 padding: 5px;
                width: 100%;
            }        
        </style>
    </head>
    
     <!-- ==== Header=== -->
      
              <div class="header" >               
                    <p align="center"><b>Dispatch Check List</b></p>
                 <p align="Left"><b>  Project Name:<apex:outputField value="{!CPWR.Name}" /></b></p>                
                   <p align="Left"><b>  Project Type : <apex:outputField value="{!CPWR.Project_Type__c }" /></b></p>   
                    <p align="Left"><b>  No of Products: <apex:outputField value="{!CPWR.Total_Product_Qty__c}" /></b></p>  
                 
                 
               </div>
     <!-- ==== Header=== -->
    
    <!-- ==== Product Deatils=== -->
    
        
        <apex:outputText style="page-break-Before: Avoid; white-space:nowrap" > 
       
       
        <div class="Content" style="position:absolute; width:100% white-space:nowrap">
    
        <table style="font-size:13px;font-face:Arial;page-break-inside: avoid;white-space:nowrap " border="1" rules="cols" cellspacing="0" width="100%" cellpadding="0"  >
             
                <tr  height="30" width="100%" style="font-family: sans-serif; white-space:nowrap;font-weight: bold; font-size: 10pt;">
                                <th align="center">Sl.No</th>
                                 <th  align="center" > Product Name</th>
                                <th align="center">Required Material Name</th>
                                <th  align="center">Orginal Quantity</th>  
                                 <th  align="center">Quantity1</th>  
                                 
                </tr>      
            
                               <apex:variable value="{!0}" var="icount" />
                                <apex:repeat value="{!listdisprod }" var="line">
                                
                               <apex:variable value="{!icount+ 1}" var="icount" />
               <tr> 
                                <td style="text-align:center; " border-style="solid;"  width="10%"  >{!icount}.</td>  
                                <td width="10%" align="center"><apex:outputField value="{!line.Product__c}"/> </td>
                                <td width="10%" align="center">{!line.Name}</td>   
                                 <td width="10%" align="center">{!line.Quantity__c }</td>
                                 
                                  <apex:repeat value="{!listlinitem }" var="Qty">
                                
                                  <td width="10%" align="center">{!Qty.Quantity*line.Quantity__c}</td>
                                 </apex:repeat>   
                              
                                
                  </tr>            
                                  
              </apex:repeat>     
                 
                 
                                 
                                  
                                                                 
                                        
            
         </table>
        </div>
    
    </apex:outputText>    
                    
             
       
    </html>
    </apex:page>

Apex Class:
public class Dispatch_Workorder_Checklist {
public Project__c CPWR {get;set;}
list<OpportunityLineItem> listlinitem = New List<OpportunityLineItem>();
list<Dispatch_Product_Checklist__c> listdisprod = New List<Dispatch_Product_Checklist__c>();
Set<ID> setproducID = New Set<ID> ();
Map<ID,Decimal> ProdQty= New Map<ID,Decimal>();



    
    public list<Dispatch_Product_Checklist__c > getlistdisprod ()
    {
    Return listdisprod ;
    }
    
    public list<OpportunityLineItem > getlistlinitem()
    {
    Return listlinitem ;
    }

    public Dispatch_Workorder_Checklist(ApexPages.StandardController controller) {
    
    CPWR=[select ID,Name,Opportunity__c,Total_Product_Qty__c,Project_Type__c from Project__c  where ID=:ApexPages.CurrentPage().getParameters().get('Id')];
    listlinitem =[select ID,Product2Id,Quantity from OpportunityLineItem where OpportunityID=:CPWR.Opportunity__c  ];
    For(OpportunityLineItem opp: listlinitem )
    {    
    setproducID.add(opp.Product2Id );
   
    ProdQty.put(opp.Product2Id ,opp.Quantity);
      
    }
    
    listdisprod =[select ID,Name,Product__c,Quantity__c from Dispatch_Product_Checklist__c where Product__c=:setproducID]; 
      
    
    }
    
    

}

My Second Repeat should stop based first repeat. Kindly Help on this


User-added image
Expected Output