Hi
I have a customization that print a report in pdf and saves it to a folder . This program is working fine. I tried to modify the report so that the pdf file is first produced and then it is read by a second program and a text file is created in the same folder.
The problem is that I cannot get the pdf file to be printed within the same report as the one trying to access the pdf file. The pdf file is only produced after the program is completed.
1) I have tried using commit statements.
2) I tried to get other reports or codeunits to fire but they do not work.
The only way I could get it to work was when the debugger was on.
Any suggestions?
Tan Eng Siong
0
Comments
|To-Increase|
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
As Belias suggested, I would try using the SLEEP command. Look into EXISTS as well. You can look for the file, if you don't find it sleep for a few seconds, then look again. If you can't find it after a few attempts then throw an error.
also, if you run the report modally, try to run it "non -modally" instead (report.run instead of report.runmodal)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Belias' runmodal v. run idea is a good one. RUNMODAL should technically hog the CPU and not let anything else happen until it is done. By using RUN instead (if you're not) it should allow the OS to schedule the threads and the previous ideas like SLEEP should work.
I know that it is possible to create a file and then do something with it in the same report as I have PDFd reports and attached them to emails many times.
wrap your report and your "3d party function" in a codeunit, and then run them sequentially
OnRun()
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Yes, I did.
>>Report.runmodal(blahblah); //this is ok because, you can let the report finish
You mean instead of launching the report from the report from itself, you want me to launch it from a codeunit?
I also have seen a feature that creates the pdf file and then attachs it to email. I will check if the developer what was done.
1. run report on a pdf printer
2. attach the saved pdf to a mail
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog