Dear Experts,
I have a report in NAv 2013. I have develop a function to send it by email with in pdf format. Code is below. Here, I am unable to set the date range for this report. In every month, this report will shoot through the job queue. I am getting error when I am running it. Kindly advise.
*This post is locked for comments
Now, the problem are resolved. I have set the filter in report trigger.(On-PreDataItem).
Data is verified. Thank you all.
I have been able to solve this issue. Please close this incidents.
Many thanks.
Hello!,
Add a new function in order to set parameters on report.
In your code:
CLEAR(MKUShyamNagarLedgerDetails); // MKUShyamNagarLedgerDetails is a Report 50088
MKUShyamNagarLedgerDetails.NewFunction(Date1,Date2); //Setting Dates parameters
MKUShyamNagarLedgerDetails.USEREQUESTPAGE(FALSE); //// for filteration
In Report
...
On-PreDataItem
Setrange(Parm1,Param2);
...
Regards
Dear Sir,
Is there any way I can set the auto filter in report that when I generate the report....
the result should come from last one month from including current date...
Date filter is blank in report...so when I run the particular codeunit...always it is asking for the date filter...
Please advice me.
Hello Manish,
Check your Report 50088, In that report need Date filter. But in your code you didn't pass date filter.
Do some changes in your code, and pass the date filter first before running/Saving the report.
I think you have problem in report mo 50088 wherein actually details are fetched in PDF
Kindly check
Dear Sir,
currently I am using the below code but there is no result:
IF WORKDATE=CALCDATE('<CM>',TODAY) THEN BEGIN
PdfDocPath :='MKUShyamNagarLedgerDetails.pdf';
Path := 'C:\Temp\'+PdfDocPath; // Directory + Path
CLEAR(MKUShyamNagarLedgerDetails); // MKUShyamNagarLedgerDetails is a Report 50088
MKUShyamNagarLedgerDetails.USEREQUESTPAGE(FALSE); //// for filteration
IF NOT MKUShyamNagarLedgerDetails.SAVEASPDF(Path) THEN
ERROR('PDF Creating Failed!\\ERROR:\\' + GETLASTERRORTEXT);
SMTpMail.CreateMessage('MKU Limited','NAV@mku.com','manish.yadav@mku.com','Ledger Details:','',TRUE);
SMTpMail.AppendBody('Dear Sir / Madam,');
SMTpMail.AppendBody('<br><br>');
SMTpMail.AppendBody('Please Find The Ledger Details in PDF Format:');
SMTpMail.AppendBody('<br><br>');
SMTpMail.AppendBody('Regards');
SMTpMail.AppendBody('<br>');
SMTpMail.AppendBody('MKU Accounts Departments ');
SMTpMail.AddAttachment(Path);
SMTpMail.Send;
ERASE(Path);
END;
In your program you can set date filter like this
"G/L Account ".SETRANGE("Date Filter",TODAY,TODAY);
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156