I've just upgraded from Navision 3.70 to NAV2009. I have quite a few reports that are generated and emailed out by NAS. In 3.7, I used code along the lines of
IF EXISTS(ReportFile) THEN
ERASE(ReportFile);
IF OrderStatus.SAVEASHTML(ReportFile) THEN
IF EXISTS(ReportFile) THEN
Send(ReportFile, Recipients, "Overdue Orders");
The SAVEASHTML call would return success but not create a file if the report was blank. In this case, the OrderStatus report would not produce any output if there were no overdue orders. In that case, the email wouldn't be sent.
Now, in NAV2009, SAVEASHTML is creating an HTML file with valid HTML for a blank report. I suppose it's not wrong, but it foils my check for a blank report.
Is there any other good way to check if a report is blank after calling SAVEASHTML?
Thanks,
Randy
Answers
if OrderStatus.hasanylinesprinted then
Send();
You need to create a boolean field in the report and set it to true either in aftergetrecord or onpresection.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n