web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Corrupted pdf fonts in batch class - catch RPC server error

(0) ShareShare
ReportReport
Posted on by 1,087

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

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    Hi win32,

    It looks like connected to print spooler service not running, please check this blog post technicalreflections.wordpress.com/.../dynamics-ax-openprinter-rpc-error

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans