Below code would help to create a table to display detailpage by using the visualforce page.
Step1:-
Inline Visualforce Page:-
Inline Visualforce Page:-
<apex:page standardController="Lead" extensions="MonthTableExample"> <apex:form> <apex:pageBlock title="Inline Visualforce Page Example"> <table border="1px"> <tr> <th></th> <th>JAN</th> <th>FEB</th> <th>APR</th> <th>MAY</th> </tr> <apex:repeat value="{!leadList}" var="a" > <tr> <th>Usage</th> <td>{! a.Jan_u__c}</td> <td>{! a.feb_u__c}</td> </tr> <tr> <th>Cost</th> <td>{! a.Jan_c__c}</td> <td>{! a.feb_c__c}</td> </tr> </apex:repeat> </table> </apex:pageBlock> </apex:form> </apex:page>
Extension:-
public class MonthTableExample { public String LId {get;set;} public List<Lead> leadList {get;set;} public MonthTableExample(ApexPages.StandardController controller){ LId = ' '; LId=System.currentPageReference().getParameters().get('id'); System.debug('...................LID=='+LId); Id i= Id.valueOf(LId); leadList = [Select Jan_c__c,Jan_u__c,feb_c__c,feb_u__c from Lead where Id=:i]; system.debug('.............................leadlist=='+leadList); } public MonthTableExample(){ } }
Step 2:- Go to Lead Page and open any Lead Account and click Edit Layout.
Step 3:- Create a new Section and Save any Name .
Step 4:- Click on Visualforce Page then show your page with name then drag on this and drop of newly created section.This Screenshot will help you.
Step 3:- Create a new Section and Save any Name .
Step 4:- Click on Visualforce Page then show your page with name then drag on this and drop of newly created section.This Screenshot will help you.
We have developed the feature for Creating tables display on detail page using VisualForce in Fieldax&Field Service Management. so kindly let us know if you have any query.
We are the ISV Partners and Please reach us for custom development => www.merfantz.com
---------------------- We Are Happy To Helping You ---------------------------