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
Fowkes1985Fowkes1985 

Change which column is totalled in VisualForce Page

I have the following code which totals a column.

<table class="remit">
    <tr>
      <th>Camp Ref</th>
      <th>Start Date</th>
      <th>Duration</th>
      <th>Role</th>
      <th>Pay</th>
      <th>Holiday</th>
      <th>Total</th>
    </tr>
    
    <apex:repeat value="{!ctsList}" var="cts">
    <tr>
      <apex:repeat value="{!$ObjectType.Camp_To_Staff__c.FieldSets.Remittance_Columns}" var="f">
        <td>
          <apex:outputField value="{!cts[f]}"/>
<!--          <apex:outputtext value="{!cts[f]}" rendered="{!f.fieldPath != 'Course_Start_Date__c'}" />
          <apex:outputText value="{0,date,dd/MM/yyyy}" rendered="{!f.fieldPath == 'Course_Start_Date__c'}">
            <apex:param value="{!NOW()}" />
          </apex:outputText>
          -->
        </td>
      </apex:repeat>     
    </tr>
    </apex:repeat>
    <tr class="totals">
      <td colspan="6" class="label" style="text-align: right">
        TOTAL
      </td>
      <td>
        <apex:outputText value="{0, number, '£'##,###.00}">
          <apex:param value="{!total}" />
        </apex:outputText>
      </td>
    </tr>
  </table>
  </body>
</apex:page>

Currently this totals the Pay Rate column (column 5), but I wish to total the Total column (column 7) and am not sure how this i referenced.  Any help please?
Best Answer chosen by Fowkes1985
bob_buzzardbob_buzzard
This is being totalled in the page controller I would say - the {!total} is merge syntax to access a total property from the controller.  You'll need to edit the apex code to make it sum a different value.