You need to sign in to do that
Don't have an account?
Aligning VF Page Columns
I have a VF page that displays Account and related Opportunities. I cannot align my totals to the proper columns as the last row on the page. Any advice?
Here's my first initial crack at this:
<apex:pageBlock title="IN-FLIGHT OPPORTUNITIES">
<apex:pageBlockSection columns="1">
<apex:pageblockTable value="{!Opportunities}" var="opps" border="0" cellspacing="0" cellpadding="0" >
<apex:column style="width:40%" headervalue="Name"> <apex:outputfield value="{!opps.Name}"/> </apex:column>
<apex:column style="width:10%;text-align:right;" headervalue="Total Contract Value">
<apex:outputfield value="{!opps.Total_Contract_Amount__c}"/></apex:column>
<apex:column style="width:10%;text-align:right;" headervalue="Revenue Current Yr">
<apex:outputfield value="{!opps.Projected_Current_Year_Revenue__c}"/> </apex:column>
<apex:column style="width:10%;text-align:right;" headervalue="Revenue Next Yr">
<apex:outputfield value="{!opps.Projected_Next_Year_Revenue__c}"/> </apex:column>
<apex:column style="width:20%" headervalue="CBP Stage"> <apex:outputfield value="{!opps.StageName}"/> </apex:column>
<apex:column style="width:10%" headervalue="Close Date"> <apex:outputfield value="{!opps.CloseDate}"/> </apex:column>
</apex:pageblockTable>
<apex:dataTable value="{!Account}" var="a" border="0" cellspacing="0" cellpadding="0" style="font-weight:bold;">
<apex:column > <apex:outputText value="Totals"> </apex:outputText> </apex:column>
<apex:column style="text-align:right"> <apex:outputField value="{!a.Grand_Total_Opps_Contract_Value__c}"/> </apex:column>
<apex:column style="text-align:right"> <apex:outputField Value="{!a.Grand_Total_Opps_Revenue_Current_Yr__c}"/> </apex:column>
<apex:column style="text-align:right"> <apex:outputField Value="{!a.Grand_Total_Opps_Revenue_Next_Yr__c}"/> </apex:column>
</apex:dataTable>
Output shows: Totals$xxxxxxx $xxxxxxxx $xxxxxxx
Instead of using a separate data table to display the (one) account, how about using the
footerValue attribute of the <apex:column> component?
<apex:column style="width:10%;text-align:right;" headervalue="Total Contract Value"
footerValue="{!Account.Grand_Total_Opps_Contract_Value__c}">
<apex:outputfield value="{!opps.Total_Contract_Amount__c}"/></apex:column>