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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

x++ Code to get the list of all available printers?

(0) ShareShare
ReportReport
Posted on by 184

Hello All,

I need to get the list of all available printers via X++ code? so that I can add it as a lookup for an ssrs report so that it lets users select printers they want

Please suggest me how to do it..

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi,

    Could you please explain your requirement? You can always show the report dialog and choose the print destination where you will get a list of printers available.

    pastedimage1645480975366v1.png

  • D365_Wibes Profile Picture
    184 on at

    Hi Gunjan,

    Thanks your reply.

    My requirement is that I ll prompting a dialog before the report is sent to printers. SO I need to add drop down in dialog where user should have all the printers

  • Martin Dráb Profile Picture
    237,882 Most Valuable Professional on at

    Which version of AX is this question about?

  • D365_Wibes Profile Picture
    184 on at

    Hi Martin,

    Its about D365 current version

  • D365_Wibes Profile Picture
    184 on at

    I am just looking for a way to get the list of all available printers via x++

  • Suggested answer
    GanapathyS Profile Picture
    75 on at

    static void AvailablePrinters(Args _args)

    {

    Microsoft.Dynamics.AX.Framework.Reporting.Shared.PrinterHelper printerHelper;

    System.Collections.ArrayList names;

    System.Collections.IEnumerator enumerator;

    str name;

    // BP Deviation documented

    printerHelper = new Microsoft.Dynamics.AX.Framework.Reporting.Shared.PrinterHelper();

    names = printerHelper.get_PrinterNames();

    if (names != null)

    {

    enumerator = names.GetEnumerator();

    while (enumerator.MoveNext())

    {

    name = enumerator.get_Current();

    info(name);

    }

    }

    }

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans