You need to sign in to do that
Don't have an account?

How to Grouping record using VF page
Hi Guys
I have created a Vf page which like a custom report.but here my problem is i am not unable to grouping the record .see my screenshot now i am getting this

I have created a Vf page which like a custom report.but here my problem is i am not unable to grouping the record .see my screenshot now i am getting this
public with sharing class PartyMaster { public List<MasterTest__c> accounts {get;set;} public String[] Groups {get;set;} public MasterTest__c j { get; set; } public String Id { get; set; } public List<MasterTest__c> jb { get; set; } public String keyword { get; set; } //Dc public PartyMaster (){ jb=new List<MasterTest__c>(); j=new MasterTest__c(); } public PageReference getid() { jb=[select ID, Name,Group__c,Master_Code__c,Date__c From MasterTest__c where Name=:id ]; return null; } public PageReference getKey_search() { jb=[select ID, Name,Group__c,Master_Code__c,Date__c From MasterTest__c where Name=:id ]; return null; } //we need to assign some temp var,for data type public date startdate1; public date enddate1; public PageReference go() { startdate1=j.Date__c; enddate1=j.Date__c; jb=[select ID, Name,Group__c,Master_Code__c,Date__c From MasterTest__c where (Date__c>=:startdate1) AND (Date__c<=:enddate1)order by Date__c ASC]; return null; } } } -------------------------------------------------------------------------------------- <apex:page controller="PartyMaster" sidebar="false" showHeader="false"><style type="text/css" media="print"> @media print { #non-printable { display: none; } #printable { display: block; width: 100%; height: 100%; } } </style> <style type = "text/css"> .colHeadr {text-align:center;} .colHeadrRight{ text-align:right; } } </style> <apex:form id="dt"> <apex:define name="body"> <div style="width:1250px;margin: 0px auto 10px auto;background-color:Gray;border: 1px solid black;"> <apex:image id="theImage" value="{!$Resource.Emami}" width="100" height="100"/> <apex:outputLink style="font-weight: bold;float:right;" value="{!URLFOR($Page.LoginPage)}"><b>Back To Home</b> </apex:outputLink> <apex:pageBlock title="BankBook Details To Search"> <!---search By Date Range--> <b>Start Date</b><apex:inputField value="{!j.Date__c}"/> <b>End Date</b><apex:inputField value="{!j.Date__c}"/> <apex:commandButton value="Go" action="{!go}" reRender="dt" style="background:pink"/> <b><apex:commandLink id="printable" onclick="JavaScript:window.print();" value="Print"/></b> <!---search By word--> <apex:inputText value="{!keyword}"/> <apex:commandButton value="Search By Group" action="{!getKey_search}" style="background:pink"/> <!---search By Id--> <apex:inputtext value="{!Id}"/> <apex:commandButton value="Search By Party" action="{!getid}" style="background:pink"/> <!---which fiels we want to display --> <apex:pageBlockSection columns="1"> <apex:pageBlockTable var="jj" value="{!jb}" style="width:100%; font-size:10pt"> <apex:column headerValue="Date" value="{!jj.Date__c}"/> <apex:column headerValue="Group" value="{!jj.Group__c}"/> <apex:column headerValue="Party Name" value="{!jj.Master_Code__c}"/> </apex:pageBlockTable> </apex:pageBlockSection> </apex:pageBlock> </div> </apex:define> <center><br/> <b><i style="font-size:10px;color:red;">Developed By GlobalNest IT Solution Pvt.Ltd. <a href="http://www.globalnest.com" target="_blank">[http://www.Globalnest.com]</a> </i></b> </center><br/> </apex:form> </apex:page>but i need this type of grouping .,....
Hi, refer below code, please make changes accordingly.
If this solves your problem, mark it as best answer. In case of any help, please let me know.