+ Start a Discussion
Supriyo Ghosh 5Supriyo Ghosh 5 

How to add date filter

Hi,

I have a vf page where i want to add a date filter on a particulat filed Date of joining.so if I select a date that should run a query which will provide me the data still that date.

Please help.

Controller

public class EmpMasterReport
{
   public Transient Date datename{set;get;}  
   public List<Employee_Master__c> EmpList {get;set;}
  
   
    public EmpMasterReport(ApexPages.StandardController stdController) 
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
        
    }
    
    public EmpMasterReport()
    {
        EmpList = new     List<Employee_Master__c>();
        EmpList = [ SELECT Name,Address__c,Date_Of_Birth__c,Date_Of_Joining__c,Date_of_Leaving__c,Thumbnail__c FROM Employee_Master__c where Active__c=true and Photo__c !=null];
    }
    
    Public pageReference exportReport()
    {
        pageReference newPage;
        String Br='EmpMasterReport';
        /*if(datename==null)
        {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO,'Please select the Date');
            ApexPages.addMessage(myMsg);
            
        }else
        {*/
            newPage = new pageReference('/apex/EmpMasterReport_PdfDownloader');
            
            /*Blob pdfpageblob;
            pdfpageblob = newpage.getcontentAsPdf();
            
            Attachment a = new Attachment();
            a.Body = pdfpageblob;
            insert a;*/
        //}
        
        return newPage;
    }
   
}

Please let me know how to do that.