I'm running a custom class to create pdf files from SalesPackingSlip and SalesInvoice reports and email them to customers.
Sometimes (say a 5%) the files are corrupted, the fonts are completely screwed and unreadable (I already test file size and number of pages, because I also get 1KB files and single paged files instead of complete ones...)
On last run the infolog shows this error "OpenPrinter_1: rc:0 lastError:1722(0x6ba) The RPC server is unavailable." and I think that could be the cause. But I can't find the reason why no exception has been thrown after this error.
The error happens somewhere inside the fetch() method of SalesPackingSlip report, is there a proper way to check the RPC server status before running the report?
My code is something like:
try
{
...
args = new Args(reportStr(SalesPackingSlip));
...
reportRun.run() //the error happens somewhere inside this call
}
catch
{
info("Report print error");
}
Thank you in advance
regards
args = new Args(reportStr(SalesPackingSlip));
*This post is locked for comments