With this code im only able to get a corrupted xlsx file in email. i have attached the image of cvs converted format.
public static void SendEmailNotification(string body,string ReportName, Id ReportId){
ApexPages.PageReference objPage = new ApexPages.PageReference('/servlet/PrintableViewDownloadServlet?isdtp=p1&reportId='+ReportId);
system.debug('ObjPage :'+objPage);
List<Messaging.SingleEmailMessage> emailList = new List<Messaging.SingleEmailMessage>();
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage ();
Messaging.EmailFileAttachment objMsgEmailAttach = new Messaging.EmailFileAttachment();
objMsgEmailAttach.setFileName(ReportName+'.csv');
objMsgEmailAttach.setBody(objPage.getContent());
system.debug('obj content 1 :'+Blob.valueof(objPage.getContent().toString()));
objMsgEmailAttach.setContentType('text/csv');
List<Messaging.EmailFileAttachment> attach=new List<Messaging.EmailFileAttachment>();
attach.add(objMsgEmailAttach);
email.setFileAttachments(attach);
List<String> Recipients = New List<String>();
email.setToAddresses(Recipients);
email.setSubject('Custom Email Notification');
email.setHTMLbody(Body);
emailList.add(email);
system.debug('email sent');
Messaging.SendEmailResult[] EmailResults = Messaging.sendEmail(emailList);
system.debug('Email result:'+EmailResults);
}