I have a PDF attachment created via visualforce email template. I have a controller grabbing all quote line items, but would like to section off the line items based on a field (which I was able to do).
Now, if there are no line items that fall under the second table's criteria, I don't want to show the table's headers.
If the number of rows with
QLI.Trade_In_Discount_Grouping__c == 'Additional Discounts'
is equal to zero, then don't show the below table at all (so the headers are not just visible).
<div id="contentToToggle">
<table border="1" cellpadding="1" cellspacing="1"
style="border-collapse:collapse;border-color:black;font-family:Helvetica;">
<tr>
<th width="6%" style="font-size:9pt;"><b>PART #</b></th>
<th width="20%" style="font-size:9pt;"><b>DESCRIPTION</b></th>
<th width="10%" style="text-align:right;font-size:9pt;"><b>DISCOUNT AMOUNT</b></th>
</tr>
<apex:repeat value="{!QuoteLines}" var="QLI">
<apex:variable id="tritemlines" value="" var="tritemlines" rendered="{!QLI.Trade_In_Discount_Grouping__c == 'Additional Discounts'}">
<tr>
<td style="font-size:9pt;">{!QLI.SBQQ__ProductCode__c}</td>
<td style="font-size:9pt;">{!QLI.SBQQ__Quantity__c}</td>
<td >{!QLI.SBQQ__NetTotal__c}" </td>
</tr>
</apex:variable>
</apex:repeat>
</table>
</div>