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..

  • Suggested answer
    GanapathyS Profile Picture
    75 on at
    RE: x++ Code to get the list of all available printers?

    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);

    }

    }

    }

  • D365_Wibes Profile Picture
    184 on at
    RE: x++ Code to get the list of all available printers?

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

  • D365_Wibes Profile Picture
    184 on at
    RE: x++ Code to get the list of all available printers?

    Hi Martin,

    Its about D365 current version

  • Martin Dráb Profile Picture
    231,760 Most Valuable Professional on at
    RE: x++ Code to get the list of all available printers?

    Which version of AX is this question about?

  • D365_Wibes Profile Picture
    184 on at
    RE: x++ Code to get the list of all available printers?

    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

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: x++ Code to get the list of all available printers?

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,760 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans