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
mobile vistexmobile vistex 

how to build visualforce page with column groupings

hi,
i  have 4 fields (agreement,driver,period,sales) in my custom object.in db it will save like followingUser-added image 
i want to show in visual force page like following
User-added image
please help me how can fill sales based on period values. any links is there please send me

 
Rajiv Bhatt 16Rajiv Bhatt 16
1. Create an agreement wrapper class
Class AgreementWrapper {
 String agreementNo;
 String driver;
 // notice that we are using a map here to map the period to sales
 Map<String,Decimal> periodSales; 
}

2. execute SOQL to fetch all agreement records from db 

3. loop over these records and prepare a List<AgreementWrapper>

4. use this List<AgreementWrapper> to display the records in the VF page

5. In the vf page for each column of period, just send in the column name as the key in the map and displa the value 
mobile vistexmobile vistex
hi thanks for your reply , can please give me sample code how to prepare agreementwrapper list 
Rajiv Bhatt 16Rajiv Bhatt 16
This should be a good starting point for understanding wrapper classes and creating one: https://developer.salesforce.com/page/Wrapper_Class