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
swapna9swapna9 

How to add dynamically one row in apex repeat

Hi,

 

I am adding quotelineitems to the quote.In pdf If line items are more table lines are not coming properly.Can any one help me.

Below is my code..

 

//Css 

.tbl_main {
font-size: 13px;
border-bottom: 1px solid #000;
border-left: 1px solid #000;

}
.tdCustom {
border-top: 1px solid #000;
border-right: 1px solid #000;
text-align: center;
}
.rBorder {
border-right: 1px solid #000;
}

 

//apex repeat table

 

<table cellspacing = "0" cellpadding = "0" border = "0" width = "100%" class = "tbl_main" >
<thead>
<tr >
<td width = "40px" class = "tdCustom"><b>Pos</b></td>
<td class = "tdCustom"><b>N P/N</b></td>
<td class = "tdCustom"><b>C P/N</b></td>
<td class = "tdCustom"><b>Lead Time</b></td>
<td class = "tdCustom"><b>Asked Quantity</b></td>
<td class = "tdCustom"><b>Batch Quantity</b></td>
<td class = "tdCustom"><b>Unit Price</b></td>

</tr>
</thead>
<tbody>
<apex:variable value="{!1}" var="rowNum"/>
<apex:repeat value="{!getdata }" var="q">
<tr >
<td class = "tdCustom"><apex:outputText value="{!FLOOR(rowNum)}"/></td>
<td class = "tdCustom"><apex:outputField value="{!q.Name}"/></td>
<td class = "tdCustom"><apex:outputField value="{!q.Client_P_N__c}"/></td>
<td class = "tdCustom"><apex:outputField value="{!q.Standard_Estimated_Lead_Time__c}"/></td>
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<apex:repeat value="{!q.batch__r}" var="c">
<apex:panelgroup rendered="{!AND(c.Quote_Line_Item__c == q.Id,c.Id !=null)}">
<tr>
<td class = "tdCustom"><apex:outputField value="{!c.Asked_Qty__c}"/></td>
</tr>
</apex:panelgroup>
</apex:repeat>
</table>
</td>
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<apex:repeat value="{!q.batch__r}" var="c">
<apex:panelgroup rendered="{!AND(c.Quote_Line_Item__c == q.Id,c.Id !=null)}">
<tr>
<td class = "tdCustom"><apex:outputField value="{!c.MOD_Maxi__c}"/></td>
</tr>
</apex:panelgroup>
</apex:repeat>
</table>
</td>

<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<apex:repeat value="{!q.batch__r}" var="c">
<apex:panelgroup rendered="{!AND(c.Quote_Line_Item__c == q.Id,c.Id !=null)}">
<tr>
<td class = "tdCustom"><apex:outputField value="{!c.Unit_Price__c}"/></td>
</tr>
</apex:panelgroup>
</apex:repeat>
</table>
</td>

</tr>

<tr >
<td class = "rBorder" width="2%"></td>
<td colspan="3" class = "tdCustom" width="49%"><apex:outputField value="{!q.Description__c}"/></td>
<td colspan="3" class = "tdCustom" width="49%"><apex:outputField value="{!q.Comments__c}"/></td>
</tr>
<apex:panelGroup rendered="{!$User.Region_Text__c == 'France'}">
<tr style="page-break-inside:avoid;">
<td class = "rBorder"></td>
<td colspan="6" class = "tdCustom">
<i><center><apex:outputfield value="{!q.Quote_Validity__c}" style="padding-left:5px;"/>.</center></i>
</td>

</tr>
</apex:panelGroup>
<apex:variable var="rowNum" value="{!rowNum + 1}"/>
</apex:repeat>
</tbody>

</table>

 

 

 

Thanks,

Shiv MahlaShiv Mahla

If many rows are there and one row has more width due to it's content than there is no way to avoid this breakup.