You need to sign in to do that
Don't have an account?
John Neff
How do I create Column summaries for a PageBlockTable?
Hello,
I have a pageBlockTable that returns a list of records, but how can I sum the column values at the bottom? Do I need to create an extension to my controller? Or is there a way I can sum the values "on the fly"?
Here is my table:
I would really appreciate any help!
Thanks,
John
I have a pageBlockTable that returns a list of records, but how can I sum the column values at the bottom? Do I need to create an extension to my controller? Or is there a way I can sum the values "on the fly"?
Here is my table:
<apex:pageBlockTable value="{!listOfCO}" var="co"> <apex:column value="{!co.Buyer_Name__c}"/> <apex:column value="{!co.Total_Order__c}"/> <apex:column value="{!co.Balance_to_Collect__c}"/> </apex:pageBlockTable>
I would really appreciate any help!
Thanks,
John
<apex:variable var="totalBalance" value="{!0}"/>
<apex:pageBlockTable value="{!listOfCO}" var="co">
<apex:column value="{!co.Buyer_Name__c}"/>
<apex:column value="{!co.Total_Order__c}"/>
<apex:column headerValue="Balance to Collect">
<apex:outputField value="{!co.Balance_to_Collect__c}"/>
<apex:variable var="totalBalance" value="{!totalBalance+co.Balance_to_Collect__c}"/>
</apex:column/>
</apex:pageBlockTable>
<apex:outputText value="{0, number, 0.00}">
<apex:param value="{!totalBalance}" />
</apex:outputText>
All Answers
<apex:variable var="totalBalance" value="{!0}"/>
<apex:pageBlockTable value="{!listOfCO}" var="co">
<apex:column value="{!co.Buyer_Name__c}"/>
<apex:column value="{!co.Total_Order__c}"/>
<apex:column value="{!co.Balance_to_Collect__c}">
<apex:variable var="totalBalance" value="{!totalBalance+co.Balance_to_Collect__c}"/>
</apex:column/>
</apex:pageBlockTable>
I am not quite sure which component to remove.
<apex:variable var="totalBalance" value="{!0}"/>
<apex:pageBlockTable value="{!listOfCO}" var="co">
<apex:column value="{!co.Buyer_Name__c}"/>
<apex:column value="{!co.Total_Order__c}"/>
<apex:column headerValue="Balance to Collect">
<apex:outputField value="{!co.Balance_to_Collect__c}"/>
<apex:variable var="totalBalance" value="{!totalBalance+co.Balance_to_Collect__c}"/>
</apex:column/>
</apex:pageBlockTable>
<apex:variable var="totalBalance" value="{!0}"/>
<apex:pageBlockTable value="{!listOfCO}" var="co">
<apex:column value="{!co.Buyer_Name__c}"/>
<apex:column value="{!co.Total_Order__c}"/>
<apex:column headerValue="Balance to Collect">
<apex:outputField value="{!co.Balance_to_Collect__c}"/>
<apex:variable var="totalBalance" value="{!totalBalance+co.Balance_to_Collect__c}"/>
</apex:column/>
</apex:pageBlockTable>
<apex:outputText value="{0, number, 0.00}">
<apex:param value="{!totalBalance}" />
</apex:outputText>