Why DRA uses Adobe Reader to print checks in D365FO and how to avoid it?

DRA uses Adobe Reader to print checks in D365FO

Let’s start with the explanation from Microsoft:

Documents that require custom margins

When the Document Routing Agent runs as a Windows service, document reports, such as checks, that require custom margins can’t be printed directly to network printers. Instead, the Document Routing Agent automatically routes those document to a target folder. New configuration properties in the application’s Settings dialog box let you define the target location for document reports that require custom margins.

When the Document Routing Agent runs as a desktop application, it continues to take advantage of Adobe Reader to spool the document to the shared printer device that is selected in Finance and Operations. To handle scenarios where documents that have custom margins must be printed, we recommend that you install the Document Routing Agent in multiple locations. Then install the printers that will handle those documents only on the Document Routing Agents that will run in desktop application mode. Alternatively, use a post-execution process to pick up the files in the target directory and direct them in the appropriate manner.

 

What Microsoft is saying about the reports, which require custom margins (as far as we know the Cheque report is the only one with custom margins in D365FO), is that Document Routing Agent (DRA) in combination with SSRS Reporting Services is not capable of conveying this information to a selected network printer directly.

Please note that in AX 2012, where we have only on-premises environments and no need for DRAs, SSRS is capable of printing reports with custom margins to network printers directly.

Why do we need Document Routing Agents in the first place

In on-premises environments, D365FO and SSRS Reporting Services can directly communicate with network printers, since they all are normally in the same corporate network. Therefore, in on-premises D365FO environments printing reports to network printers works without any additional application, as it was working in AX 2012.

Once we move to the cloud, direct printing is no longer an option, because D365FO nor SSRS Reporting Services don’t have access to network printers that dwell behind a company firewall in a corporate network. In order to support printing to network printers, Microsoft created Document Routing Agent (DRA).

What is DRA and how it works

DRA is an application provided by Microsoft and can be downloaded from D365FO (Organization administration > Setup > Network printers). You can install DRA on a print server or on a user workstation, which are part of the corporate network.

D365FO DRA

DRA can run in two modes: as a desktop application (usually when installed on a user workstation) or as a Windows service (when installed on a print server).

DRA has two responsibilities: to provide information about the network printers to D365FO, and to route documents for printing from D365FO in the cloud to corporate network printers.

 

When D365FO prints a report via DRA, SSRS Reporting Services generates an EMF image for each page of the generated document. D365FO then temporarily saves the generated EMF files to Azure Blob storage along with the corresponding print-settings in the form of an XML file. The print-settings contains information about the target printer, page orientation, number of copies, etc.

 

The generated EMF files and print-settings of a printing D365FO report represent a print job information, which will be downloaded from Azure Blob storage by DRA. DRA will use it to print the document to the target printer.

D365FO also creates a new record in Document routing status, a table containing the printing log for all reports and printers.

DRA uses the polling mechanism to check for any changes in the blob containers, i.e. if a new document for printing is available for download. Since each DRA is linked to particular network printers, it will be downloading only those documents routed to the printers on the DRA’s printer list. After DRA downloads a print job information, it will create a print job for the target printer, and send the information back to D365FO to update the Job status field to Succeeded in the Document routing status table. This doesn’t necessarily mean that the printing has succeeded but only that the print job has been successfully created and sent to the Windows Print Spooler.

DRA will take care about the page orientation, page range, number of copies, etc. that you can set up on the Print destination settings form. What you cannot do is to set up the input printer trays nor to apply any of the mentioned settings to particular report pages.

What is so special about Checks

When D365FO prints a report without custom margins via DRA, SSRS Reporting Services generates EMF files and saves them to Azure blob storage. However, when D365FO prints a report with custom margins via DRA, such as Cheque, SSRS Reporting Services generates a PDF document instead of EMF images, which is again saved to Azure Blob storage, together with the corresponding print-settings.

Remember that the print-settings contain the information about the target printer (i.e. the printer dedicated to printing checks), which means that only DRAs linked to the Check printer will be triggered.

When a DRA downloads the PDF output document from Azure Blob storage, it will not create a print job as it would with EMF images. EMF is one of the Windows Print Spooler formats, whereas PDF is not. This is why DRA has to employ an application, which knows how to print PDFs. Microsoft chose to use Adobe Acrobat Reader invoked from command line interface (CLI) for this purpose.

Since DRA uses Adobe Acrobat Reader invoked through CLI to print reports with custom margins such as Cheque, this approach cannot be used when DRA runs as a Windows service. In that case, the printing PDFs are saved to a local folder, which is configured in Settings of the DRA app.

 

Learn about document routing from D365FO in the cloud to the local file system >>

For printing reports with custom margins (i.e. for printing as PDF documents), the same limitations still apply; you cannot configure the input printer trays, apply different orientation to different document pages, etc.

Let’s summarize

Checks can only be printed to network printers via Adobe Acrobat Reader, if DRA runs as a desktop app, or they can be saved to a local folder, if DRA runs as a Windows service. In that case, the target folder is configured in the DRA’s settings, which is used for printing checks to the Check printer.

If you want to print your checks directly to the Check printer, you will need to install DRA on a workstation and run it as a desktop app. DRA will be using Adobe Acrobat Reader on the same workstation for printing checks on the Check printer.

However, it is not enough to just install DRA and Adobe Acrobat Reader on a user workstation. Let’s write down all the necessary steps:

  1. Install DRA on a workstation. When installing the DRA, make sure you are logged in as the Admin user.
  2. Set up DRA to register the Check printer.
  3. Ensure that DRA is running as a desktop application.
  4. Open D365FO and activate the Check printer in Organization administration > Setup > Network printers, for each legal entity that you want to enable printing checks to this printer.
  5. Before printing any check from D365FO, on the workstation configure Adobe Reader print settings to prevent document scaling.
    To accomplish this, open an arbitrary PDF document with Adobe Reader on the workstation, set the print settings required for printing checks, print the document to the Check printer, and close Adobe Reader.

    This is required because when DRA invokes Adobe Reader to print the Cheque document, the last print settings used in Adobe Reader will be applied and used in any subsequent printing.

Printing checks without Adobe Reader

Can we print checks in D365FO without Adobe Reader? If you are using Docentric, you can!

When printing reports with Docentric, there is no complications with custom margins, because they are set on Docentric templates and become margins of the generated documents. While Docentric still reuses the existing DRAs to print reports to network printers, it always generates EMF files, and Adobe Reader is never employed for printing, regardless of whether DRA runs as a desktop app or as a service.

By using Docentric, you can enable printing reports with custom margins such as Cheque with DRA running as a service. As a bonus, you can configure the description of the printed checks in DRA Logs and Document routing status to contain the check number, by setting Report caption in Docentric report setup for the Cheque report.

 

If we don’t set Report caption in Docentric report setup, the default caption will be used. Depends on the report, sometimes the default caption is the report AOT name (e.g. PurchPurchaseOrder.Report) or the label of the report menu item (e.g. “Print checks” or “Show invoice”).

Other DRA limitations we are going to fix

We are aware that, besides using Adobe Reader for printing checks, DRA still has many other limitations such as serial single-threaded processing of print jobs, causing this way printing bottlenecks.

The printing via DRA isn’t just slow but also not robust. For example, if the printing to one printer fails, the rest of the print jobs will also fail. Some partners solved this issue by having a separate DRA for a single printer.

Next, DRA doesn’t support the information about the user who triggers the printing and consequently makes it impossible to introduce a centralized printing solution such as the FollowMe printing.

DRA also doesn’t support the information about the input printer trays or page orientation neither for the whole document nor for the particular document pages.

On top of all that, each time when you upgrade D365FO, you also need to upgrade all your DRAs – manually.

Because of all these numerous drawbacks, we plan to develop Docentric DRA that will not only address these shortcomings but also will enable configurable document routing from D365FO in the cloud to the local file system.

Please reach us at support@docentric.com if you want to get involved!

You can still route your PDF documents to local folders if you want

It’s interesting to mention that Docentric introduced an additional option: Print as PDF, which can be configured on the Print destination settings form > Docentric Printer print destination. By using it, you can fully control whether you want to employ Adobe Acrobat Reader for physical printing or to route PDF documents to a local folder, when printing reports using Docentric Printer print destination.
Learn more >>

 

We are also preparing a new series of articles on how easy it is to design checks with Docentric. Stay tuned!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Docentric respects your privacy. Learn how your comment data is processed >>