Detect blank report after SAVEASHTML

rorrison
Member Posts: 12
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
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
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
0
Answers
-
You can add a function in your report OrderStatus that returns a boolean field if the body section has been printed.
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.0 -
Thanks. I had thought of that but hoped for a more generic solution, as there are quite a few reports that I'll need to modify, and some of them are rather complicated. Oh well.0
-
You can check the size of the file. If it's greater than certain size then do something else0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions