(This was originally posted under Stray Clicks but has been recognized as a separate problem and reposted)
A LoopArray is generating more than 200 PDF reports. Prior to recent updates of the OS and Panorama, it had been running correctly. This past week it was discovered that a seemingly random number of the PDFs were riddled with field and variable errors. It seems to be somewhere around 10% scattered within the overall output and does not affect the same reports on each run.
Months ago the same printtopdf procedure was randomly having similar issues using the code below:
printtopdf Path+Name,”Database”,XYZ,”onerecord","true","Form”,”Account Report"
In this case, ”Account Report" was not the open form, but too often another open form printed, or the unopened datasheet or an unopened form, and occasionally the procedure itself got printed. Most would be fine, with a smattering being wrong.
So I made sure that ”Account Report" was open and active and the same line of code became far more reliable but still had occasional failures. I made it entirely reliable by adding a wait and showpage:
ShowPage
wait 1
printtopdf Path+Name,”Database”,XYZ,”onerecord","**true**","Form”,”Account Report"
That is where it has been until the noted recent updates of the OS and Panorama. I have it working correctly again (fingers crossed) by adding more waiting:
wait 2
ShowPage
wait 2
printtopdf Path+Name,”Database”,XYZ,”onerecord","**true**","Form”,”Account Report"
The percentage of errors clearly goes up or down depending on the length of the wait. The server running this is an M4 Mini on OS 15.1.1. The same problem occurs on an Intel i7 Mini but requires less wait time to avoid the issue.
My guess is that the screen has to catch up with the process before printing, although watching the screen I never see the errors.
I don’t know if the wait is more effective before or after the ShowPage, if only one of them is making the difference, or if it’s the cumulative value that matters and the ShowPage is unnecessary. I need to experiment more on that but each change requires quite a while to test and then check the results.
Especially since the i7 used for development is more tolerant than the M4, where clients log onto a website to review their accounts, there’s a lot of fear in making any changes. Client confidence runs low when they see garballed reports.