Finance and Operations applications use the Document Routing Agent to manage the spooling of documents to network printer devices. 

While printing any document to printer using document routing agent , users see all the printers in their dropdown which are configured in DRA(Document routing agent). If you would like to know more about how to configure DRA for printing you can refer below link

https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/analytics/install-document-routing-agent

In this blog post , I am going to show how you can customize finance and operation to show users their assigned printers while printing any report from finance and operations.

I added one button called “users” on the Network printers form. 

You can navigate to this form from  Organization administration > Set up > Network printers

image

When you click users button , you can see below form which has assigned users specific to printers .This new form is copy of users groups form which shows list of printers , all users and enabled users for a specific printer.

image

Once you select printer on the printers tab , users for that printers can be selected from enables users tab as shown below.

image

So in my scenario , I assigned  printer 2 and Printer 3 to admin . So while printing report you can see  from below screenshot , only printers associated with my user are available for me to print.

image

Once you create form which associates users with their printers , showing printers in the print dialog can be done by implementing delegate buildPrinterComboBox from class SRSPrintDestinationSettingsDelegates . Complete project can be downloaded from here.

public static class MySRSPrintDestinationSettingsHandlers
{
    [SubscribesTo(classStr(SRSPrintDestinationSettingsDelegates), delegateStr(SRSPrintDestinationSettingsDelegates, buildPrinterComboBox))]
    public static void SRSPrintDestinationSettingsDelegates_buildPrinterComboBox(FormComboBoxControl deviceList)
    {
        NetPrinterUsers       printerUsers;
        SysCorpNetActivePrinters activePrinters;
        
        deviceList.clear();

        while select PrinterName
                        from activePrinters
                    exists join printerUsers
                        where printerUsers.PrinterName == activePrinters.PrinterName
                           && printerUsers.UserId      == curUserId()
        {
            deviceList.add(activePrinters.PrinterName);
        }
    }

}