Calculate the Column values at visual force page


Requirement: Calculate total quantity on visualforce page

Solution: 
<apex:page>
  <form>
 <apex:variable var="countqu" value="{!0}"/>

  <apex:repeat var="count" value="{!lst}" >

 <td > <apex:variable var="countqu" value="{!(countqu + round(count.quantity__c,0 ))}"/> <apex:outputtext value="{!round(count.quantity__c,0 )}" /> </td>

  </apex:repeat   >

  <td>{!countqu} </td>

</form>

</apex:page>


OUT PUT :

Quantity
 10
20
30
40
----------
100 ( calculate on vf Page)
--------

Comments

Popular posts from this blog

Salesforce Spring 16 Release Exam (Maintenance Exam Q&A) for Developer 201 Admin

Show Hyper Link On Add Error in Salesforce Trigger

Show the Success Message before Redirecting the Detail page on Visualforce Page