Skip to main content
Hello, 

I have a pageBlockTable where I am attempting to display and total current outstanding invoices.  Here is the code behind my table, which compiles without error: 

 

<apex:pageBlock title="Invoices This Week">

<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:pageBlock>

but my "Total" variable does not display (see picture below).  What piece am I missing in order to make this show??? Thank you in advance for your help!

 
6 个回答
  1. 2015年4月10日 15:37
    Hey Bob - a quick update... I used the info you gave me at put this together:

     

    <h2>Invoicing</h2>

    <apex:panelGrid width="100%" columns="2" styleClass="paneltop">

    <apex:pageBlock title="Invoices This Week">

    <apex:variable var="totalBalance" value="{!0}"/>

    <apex:variable var="totalOrders" 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:variable var="totalOrders" value="{!totalOrders+co.Total_Order__c}"/>

    </apex:column>

    </apex:pageBlockTable>

    <br></br>

    <apex:panelGrid columns="2" width="100%">

    <apex:outputText style="font-weight:800" value="Total Funds Not Yet Collected: ${0, number, 00,000}">

    <apex:param value="{!totalBalance}" />

    </apex:outputText>

    <apex:outputText style="font-weight:800" value="Total Orders Sent this Week: ${0, number, 00,000}">

    <apex:param value="{!totalOrders}" />

    </apex:outputText>

    </apex:panelGrid>

    and it is working great!
0/9000