You need to sign in to do that
Don't have an account?
sfdc fresher
i want to set the heading of 3 columns of data
i want to print the account names in 3 columns(3 differnt types of accounts) , i need to add the heading to those columns like Accoun1..Account 2 and Account 3, and need to disply the in columns. kindly help me how to achieve this.
controller logic:
public class DisplayRecordsDatewise {
List<Account> act1;
List<Account> act2;
List<Account> act3;
public List<Account> getAccounts1()
{
act1=[select id,name from Account where createdDate!=Yesterday limit 10];
return act1;
}
public List<Account> getAccounts2()
{
act2=[select id,name from Account where createdDate!=Last_WEEK limit 10];
return act2;
}
public List<Account> getAccounts3()
{
act3=[select id,name from Account where createdDate=LAST_N_DAYS:120];
RETURN act3;
}
}
vf logic:
<apex:page controller="DisplayRecordsDatewise">
<apex:form >
<apex:pageblock >
<apex:pageBlockSection columns="3">
<apex:dataList value="{!Accounts1}" var="a">
<apex:outputText value="{!a.name}" />
</apex:dataList>
<apex:dataList value="{!Accounts2}" var="a">
<apex:outputText value="{!a.name}" />
</apex:dataList>
<apex:dataList value="{!Accounts3}" var="a">
<apex:outputText value="{!a.name}" />
</apex:dataList>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
controller logic:
public class DisplayRecordsDatewise {
List<Account> act1;
List<Account> act2;
List<Account> act3;
public List<Account> getAccounts1()
{
act1=[select id,name from Account where createdDate!=Yesterday limit 10];
return act1;
}
public List<Account> getAccounts2()
{
act2=[select id,name from Account where createdDate!=Last_WEEK limit 10];
return act2;
}
public List<Account> getAccounts3()
{
act3=[select id,name from Account where createdDate=LAST_N_DAYS:120];
RETURN act3;
}
}
vf logic:
<apex:page controller="DisplayRecordsDatewise">
<apex:form >
<apex:pageblock >
<apex:pageBlockSection columns="3">
<apex:dataList value="{!Accounts1}" var="a">
<apex:outputText value="{!a.name}" />
</apex:dataList>
<apex:dataList value="{!Accounts2}" var="a">
<apex:outputText value="{!a.name}" />
</apex:dataList>
<apex:dataList value="{!Accounts3}" var="a">
<apex:outputText value="{!a.name}" />
</apex:dataList>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Raj Vakati
Try this page