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
adi salesforceadi salesforce 

Display list of industries in a column and rating values in a row like table

                     Hot      cold     warm
Education
energy
banking
-
-
-

Like this I want to display in table
NagendraNagendra (Salesforce Developers) 
Hi Adi,

May I suggest you please check with below blog post which might help you further with the above requirement. Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra
 
adi salesforceadi salesforce
Hi Nagendra,
Thankyou for responding but the link you have provided is not meeting my requirement.could you see my requirement once.
Bhargavi TunuguntlaBhargavi Tunuguntla
Hi Adi,

You can use the below code for generating the table :

VF Page:
<apex:page controller="TableUI_ExtractValues">
    <table>
        <tr>
            <th> Name</th>
            <apex:repeat value="{!ratingList}" var="rate">
                
                <th>
                    {!rate}  &nbsp;&nbsp;
                </th>
               
            </apex:repeat>  
        </tr> 
        
        <apex:repeat value="{!industryList}" var="industry">
            <tr>
                <td>
                    {!industry} 
                </td> </tr> 
        </apex:repeat>  
        
    </table>
</apex:page>

Class:
 
public class TableUI_ExtractValues {
    public List<String> ratingList {get;set;}
    public List<String> IndustryList {get;set;}
    public TableUI_ExtractValues()
    {
       ratingList=NEW lIST<sTRING>();
        IndustryList=new List<String>();
        Schema.DescribeFieldResult fieldResult = Lead.Rating.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for( Schema.PicklistEntry f : ple){
            
            ratingList.add(f.getLabel());
        }
        Schema.DescribeFieldResult fieldResult1 = Lead.Industry.getDescribe();
        List<Schema.PicklistEntry> ple1 = fieldResult1.getPicklistValues();
        for( Schema.PicklistEntry f : ple1){
            
            IndustryList.add(f.getLabel());
        }
    }
    
}

Thanks
Bhargavi.​​




 
adi salesforceadi salesforce
Hi Bhargavi,
Thank you for the solution.I got the exact requirement but now there another requirement is I want to no.of records related with that picklist values.
 Hot      cold     warm
Education
energy
banking
-
-
-
 
adi salesforceadi salesforce
                           Hot      cold     warm
Education           10         5         0
energy                 20       0          10
banking                15      5          5
-
-
-
like this I have to get the vf page
adi salesforceadi salesforce
The page should be displayed like pageblocktable not with the repeat