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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Print from X++ with printer settings (preferably SRSPrintDestinationSettings)

(0) ShareShare
ReportReport
Posted on by

Hi

How can i print a random file (like pdf) from disk/network to any printer. Preferably using SRSPrintDestinationSettings so i can use the printer dialog (SrsReportRunUtil::showSettingsDialog(printJobSettings)) and let the user pick a printer, trays and all other settings.

So not just the printername, but also all the other options should be respected (amount of copies, tray, ...)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    The AX reports do come from SSRS itself, and the printing module is using SSRS too.

    So if you want to print something that is already in PDF, you will not be able to utilize the facility you mention above. A PDF document could be opened though in an HTML control if you install a compatible PDF viewer software with a browser plugin, from where the software could handle printing.

    Alternatively you could write some code and attempt the printing from using .Net namespaces.

    http://www.artofcreation.be/2014/01/27/how-to-print-any-file-in-ax/

    I also found some relevant X++ code too:

    https://community.dynamics.com/ax/b/axaptavsme/archive/2013/08/30/print-pdf-files-from-ax-x-code

  • Community Member Profile Picture
    on at

    At the moment i'm using a .NET class (from the Ex Arte package) to do the printing.

    It accepts a file location and an SRSPrintDestinationSettings object.

    I've done some reversing with ILSpy and noticed they translate the SRS object to a System.Drawing.Printing.PrinterSettings object and from there on print using regular .NET classes. GDPicuture.net classes

    However, it crashes when i use a printer that is not known by the AOS (even though it's ran from client).

    I have a feeling the calls on the DLLs are being called on server? Could this be right?

    My other feeling is that it only supports "spooler" printers instead of "queue" printers. But that's out of my comfortzone :)

  • Vilmos Kintera Profile Picture
    46,149 on at

    I've updated the previous post with some more information I could find, I hope it gives some more options.

  • Community Member Profile Picture
    on at

    I was hoping to avoid having to write X++/.NET code to parse the SRSPrintSettings object :)

    But it seems like my only option..

  • Suggested answer
    Mrdude Profile Picture
    285 on at

    you need use dot net framework

    in below you can found that in c#

    stackoverflow.com/.../send-pdf-file-to-a-printer-print-pdf

    by some change on that you can use that in x++

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans