This blog assists those who are struggling to set up some aspect of printing in D365 for Operations due to the limited documentation in circulation.
We had 2 scenarios at our customer site:
– Barcode printing.
– FollowMe printing.
Barcode printing is not meant to be complex, but when printing to screen or printer, it did not work. The reason was that the machine which generated the report must have the barcode font installed. When printing to screen a webpage is generated that contains the following content.
style=”word-wrap:break-word;white-space:pre-wrap;font-family:’BC UPC HD Wide’;”>
This content is pointing to font type ‘BC UPC HD Wide’ If this is not installed, it prints .7E6DK4/;;<@@=. instead of a nice-looking barcode. This is additionally confusing for developers when it is installed on their local Dev VM and subsequently doesn’t work at the customer site.
Printing on device
When that is resolved, the next issue is physical printing. Printing is using a device that is in your network. Dynamics 365 in the cloud is not aware where that printer may be. To address this gap Microsoft introduced the Document Routing Agent: https://docs.microsoft.com/en-us/dynamics365/operations/dev-itpro/analytics/print-documents
In my opinion the only the suitable configuration is to run the agent as a Windows service as this does not bother the user. https://docs.microsoft.com/en-us/dynamics365/operations/dev-itpro/analytics/run-document-routing-agent-as-windows-service
When creating this service, there are some pitfalls:
- Be sure to have a legal PDF viewer installed on that server.
- After installation
o First change the service account of the service to the admin user of the Dynamics 365 environment (by default it is local host). If this is not done correctly, it will create several errors in the Error Log.
o You can only get printers in Dynamics 365 by installing them on the server where the Document Routing agent is running. (Also the printer drivers needs to installed on the server.) Start application in the Internet browser and open the network printers form. All configured printers will appear. The printers are now also available for all other users. This includes adding new printers in the future.
Follow me printing is where the logic determining the printer is based on the file owner. For instance, a user prints to a pool and the document is physically printed when an identification (ex. A keycard), is scanned at a printer.
The document that is sent to the routing agent is a pdf file that is stored in a file share on the routing agent. The file owner of this pdf is the service account of the service. In the previous topic, we recommended setting that to the admin users. As the file owner is now not the person who printed the document, the result will be that the document is not physically printed based on the user making the print request.
The current work around is that the user must save to pdf, open the document and print from the pdf viewer. This is not a sustainable solution, for instance when printing bulk documents.
Hopefully Microsoft will solve this shortly.