Report processing OR No output

mahesh
Member Posts: 115
Hi guys,
I found problem when i was trying to send report via email automatically.
Before sending email, i need to check whether report has Output or still it is under process. Currentrly i have set wait time of 10 sec. But if there is not any file generated in assigned folder after 10 sec then there are two chances 1) Report dont have any ouput. 2) Report is still under process.
There is not any inbuilt function stating this problem. I want to generate exact error message by coding. plz help.
Regards
mahESH
I found problem when i was trying to send report via email automatically.
Before sending email, i need to check whether report has Output or still it is under process. Currentrly i have set wait time of 10 sec. But if there is not any file generated in assigned folder after 10 sec then there are two chances 1) Report dont have any ouput. 2) Report is still under process.
There is not any inbuilt function stating this problem. I want to generate exact error message by coding. plz help.
Regards
mahESH
0
Comments
-
There is a way... I saw some code in tool for creating files for on-line help in NAV, which was detecting, if the report is "Report" or "Batch" (processing only) - it is a part of the report "Generate HTML Help" which is on the MBS Tools CD. There is the code:
IsABatchJob(Obj : Record Object) : Boolean IF Obj.Type <> Obj.Type::Report THEN EXIT(FALSE); Obj.CALCFIELDS("BLOB Reference"); Obj."BLOB Reference".CREATEINSTREAM(ObjStream); WHILE NOT ObjStream.EOS DO BEGIN Counter := ObjStream.READ(BinData); FOR Counter := 1 TO 1998 DO BEGIN intChar[1] := BinData[Counter]; intChar[2] := BinData[Counter+1]; intChar[3] := BinData[Counter+2]; IF (intChar[1] = 37) AND (intChar[2] = 72) AND (intChar[3] = 4) THEN IF BinData[Counter+4] = 1 THEN EXIT(TRUE); END; EXIT(FALSE); END;
0 -
thanx for appreciated reply...
but if a report is not processing only & which takes too much time to execute then i just want to know by coding dat still report is executing or it has no output?0 -
If you are running the process on one client/NAS, your checking code will not run until the report is processing data. Do not forget that NAV is "single-threaded" application.0
-
Hi,
the problem I am facing is that I am mailing the report in pdf format to customers, but sometimes, before the pdf is fully generated, it gets transferred to e-mail, so the file size is less and it is corrupted, but when you check the file it is fully generated.
So we need some solution which will halt mail till the file is fully generated. So is sleep only solution? If it is then it is not totally accurate and also time consuming.0 -
1) One way is to try to open the file for writing. if you succeeded, the file was closed and is fully generated. During process of generation is the file locked for writing for another process. If you fail, try it in e.g. 500ms...
2) Another way is depending on used PDF printer. Some has API you can use to check, if the file was generated...0
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