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
venkatasubhashvenkatasubhash 

Breaking a table Dynamically ??

The following is my code i retrive it from quote line items....i am rendering it as pdf ..i am able to get the table with serial num as what i give in the quote as 1 , 2 ,3 etc...in the table, but i want the table to break after serieal num 1 and separate table for 2 and so on...plz hlp me out...

 

 

 

<table border="1" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">S.No:</font></td>
       <td bgcolor="#C0C0C0" width="40%"><font face="Arial">Product--Description</font></td>             
       <td bgcolor="#C0C0C0"><font face="Arial">QTY</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Unit Price</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Total Price</font></td>
</tr>
 
<tr>
       <apex:repeat value="{!QuoteLineItem}" var="a">
          <tr>
            <td >{!a.Serial_Num__c}</td>
        
             <td width="40%">{!a.PricebookEntry.Name}--{!a.Description}</td>
            
             <td>{!a.Quantity}</td>
             
             <td><apex:OutputField value="{!a.UnitPrice}"/></td>
             <td><apex:OutputField value="{!a.TotalPrice}"/></td>
                  
             
          </tr>
       </apex:repeat>  
</tr>

<tr>

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
SidzSidz

Venkatasubash,

use the repeat statement in the begininng of the table rather than for single row.

like

<apex:repeat value="{!QuoteLineItem}" var="a">

<table border="1" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">S.No:</font></td>
       <td bgcolor="#C0C0C0" width="40%"><font face="Arial">Product--Description</font></td>     

        
       <td bgcolor="#C0C0C0"><font face="Arial">QTY</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Unit Price</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Total Price</font></td>
</tr>
 
<tr>
      
           <td >{!a.Serial_Num__c}</td>       
             <td width="40%">{!a.PricebookEntry.Name}--{!a.Description}</td>
            
             <td>{!a.Quantity}</td>
             
             <td><apex:OutputField value="{!a.UnitPrice}"/></td>
             <td><apex:OutputField value="{!a.TotalPrice}"/></td>
                  
             
          </tr>
    </table>

</apex:repeat>

 

should give u a new table for each s.no

 

hope it helps

Sidz 

All Answers

SidzSidz

Venkatasubash,

use the repeat statement in the begininng of the table rather than for single row.

like

<apex:repeat value="{!QuoteLineItem}" var="a">

<table border="1" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">S.No:</font></td>
       <td bgcolor="#C0C0C0" width="40%"><font face="Arial">Product--Description</font></td>     

        
       <td bgcolor="#C0C0C0"><font face="Arial">QTY</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Unit Price</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Total Price</font></td>
</tr>
 
<tr>
      
           <td >{!a.Serial_Num__c}</td>       
             <td width="40%">{!a.PricebookEntry.Name}--{!a.Description}</td>
            
             <td>{!a.Quantity}</td>
             
             <td><apex:OutputField value="{!a.UnitPrice}"/></td>
             <td><apex:OutputField value="{!a.TotalPrice}"/></td>
                  
             
          </tr>
    </table>

</apex:repeat>

 

should give u a new table for each s.no

 

hope it helps

Sidz 

This was selected as the best answer
venkatasubhashvenkatasubhash

hi sidz...thank you it worked but i have my  seriel num as 1.1.1,1.2 etc.....i should get these in one table and the next 2,2.1,2.2... in other and so on.....please help me finding the way?