Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to print invoices to file (e.g. PDF) in AX 2009?

Posted on by 1,085

Hi,

i'm new to AX 2009. 

 

I'm looking for a way to put invoices into PDF files. 

I've browsed through EPSendDocument (it looks deprecated, isnt it?), PrintJobSettings, but can't find the proper way to do that. 

 

At the moment i've got CustInvoiceJour table as the result of a query. How do I print each invoice to PDF file via code?

I've seen many solutions with reports, but i don't have any report available, and don't want to use it if possible. 

 

Thank you for your help

ciao

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to print invoices to file (e.g. PDF) in AX 2009?

    Hi,

    Just a heads up regarding the use of EPSendDocument class:

    If you intent to use this class as generator for creating pdf invoices run in batch, the handlement of the temp files (gets created when the AOS service account runs the code, where it collects printer settings and building up the actual pdf) does not get deleted. The files are located on the batch AOS server, under: C:\Users\AOSSERVICEACCOUNTNAME\AppData\Local\Temp\

    I experienced this to be a problem, since that folder eventually got full of files and the logic was unable to draw a new name for the temp file (uses a sort of HEX-logic, and it goes up to FFFFFF).

    The solution for this, is either clear this folder by a scheduled job (windows bat-file), or use different approach in the code, which I suggest, since it isn´t best practice to generate a lot of files, and use a different handlement to delete these files.

    I would have a look at the class: PDFViewer, since that class handles the delete of the temp files, as well as the handle of either client base runs, or run in batch.

    //Richard Hellstenius

  • Suggested answer
    Brandon Wiese Profile Picture
    Brandon Wiese 17,786 on at
    Re: How to print invoices to file (e.g. PDF) in AX 2009?

    The code in EPSendDocument\makeDocument() does exactly what you are asking.  You will need a report, probably SalesInvoice in this case.

  • Julie Johnsey Profile Picture
    Julie Johnsey 570 on at
    Re: How to print invoices to file (e.g. PDF) in AX 2009?

    When yo print the report manually, you get the option to print the report to a file.  PDF is one of the file options.  I don't know how to tell you to set up a batch job to make this happen automatically, but it can be done.  Also, you can make screens print int a PDF format.

  • Nielsen Tom Profile Picture
    Nielsen Tom 115 on at
    Re: How to print invoices to file (e.g. PDF) in AX 2009?

    Hi,

    Please feel free to take a look at Liaison Messener EDD,     www.liaisonsc.com

    Messenger EDD automates busines form and report distribution and uses your existing AX reports. The end user selects either a batch or a single Invoice through your normal print process in Dynamics AX but now uses our Messenger EDD print driver and Messenger will then distribute the Invoices based on rules you set up at initial configuration.

    For example, through the single print selection:

    - Distribute Invoices to the customers preference (print, fax, or email) if email, it attaches a PDF

    - Archive a copy to desired folder

    - Print a hard copy to attach to other paperwork

    - Attach a static attachment like terms and conditions

    PDF creation is included with the product.

    Set up similar rules for Sales Orders, PO's, Statements or even shipping documents like Packing Slips, Picking Tickets, Bills of Lading and International docs.

    Please reach me at tom@liaisonsc.com or 714.543.9877x201 if you have any questions or would like to view an on-line demonstration.

    Best Regards,

    Tom Nielsen

    Liaison Software

    714.543.9877x201

    www.liaisonsc.com

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans