Filtering printers on the user name or other criteria

You can filter the list of direct printers based on the user name or any other criteria. This is possible with an integration event. The event receives the direct and local printer names and determines if the printer should be removed from the list of available printers.

Here is the definition of the event:

    [IntegrationEvent(false, false)]
    localprocedureOnFilterDirectPrinters(CloudPrinterName: Text; LocalPrinterName: Text; var RemoveFromList: Boolean)
    begin
    end;

This is an example of how to use it:

    [EventSubscriber(ObjectType::CodeUnit, Codeunit::"ForNAV Local Printers", 'OnFilterDirectPrinters', '', false, false)]
    local procedureOnFilterDirectPrinters(CloudPrinterName: Text; LocalPrinterName: Text; varRemoveFromList: Boolean)
    begin
        if CloudPrinterName 'P' then RemoveFromList := true;
    end;

The sample will remove any direct printer with a name greater than P from the list.

Requirements: Customizable Report Pack 7.4.0.0 or newer
Creation date: 2/14/2024 3:46 PM      Updated: 2/29/2024 1:48 PM