Dear Experts,
I have created a report, which show the customer masters with some details. Actually, we want to track the how many customer created in last month. We want to run it on every month of the starting date for example 1st august 2018. Report would show the customers created in July month. I am facing problem to write the filter in my report for get the data for last month record. I want to run it through job queue. Please help to resolve my filter problem.
My code is below.
OnRun()
PdfDocPath :='CustomerMaster.pdf';
Path := 'C:\Temp\'+PdfDocPath; // Directory + Path
//Customer.SetFilters(FORMAT(CALCDATE('<-1M>',TODAY)));
CLEAR(CustomerMaster); // CustomerMaster is a Report 50120
CustomerMaster.USEREQUESTPAGE(FALSE);
IF NOT CustomerMasterMKU.SAVEASPDF(Path) THEN
ERROR('PDF Creating Failed!\\ERROR:\\' + GETLASTERRORTEXT);
SmtpMail.CreateMessage('XYZ Limited','NAV@xyz.com','abc@test.com','Customer Details:','',TRUE);
SmtpMail.AppendBody('Dear Sir / Madam,');
SmtpMail.AppendBody('<br><br>');
SmtpMail.AppendBody('Please Find The Customer Details in PDF Format:');
SmtpMail.AppendBody('<br><br>');
SmtpMail.AppendBody('Regards');
SmtpMail.AppendBody('<br>');
SmtpMail.AppendBody('Accounts Departments ');
SmtpMail.AddAttachment(Path,PdfDocPath);
SmtpMail.Send;
ERASE(Path);
*This post is locked for comments