You need to sign in to do that
Don't have an account?
Multiman
Create a roll-up sum of all items in a pageBlockTable column
Hi
how can I create and render the total amount of all values that are displayed in a certain column of a pageBlockTable ?
Since VF iterates over a set of objects there should be a way to do that without a custom controller.
Any hint is appreciated.
Thanks
Alex
In my opinion, you can use Aggregate function in controller or some business logic about total sum.
AggregateResult[] groupedResults = [SELECT SUM(Amount)aver FROM Opportunity];
Hope this helps.
I found this solution which I would like to share
<apex:variable value="{!0}" var="MaxDocCount"/>
<apex:repeat var="rep" value="{!account.Repositories__r}">
<apex:variable var="MaxDocCount" value="{!IF(TEXT(rep.CR_Number_of_k_Docs__c) = '', MaxDocCount, MaxDocCount + rep.CR_Number_of_k_Docs__c)}"/>
</apex:repeat>
The if function is used to skip items with an empty doc count value. So you can do that without a custom controller.