Why is Container contents report always printed to Screen in D365FO

This article explains why Container contents report is always printed to Screen no matter which print destination you select on the Print destination settings form opened from its report dialog form.

The WHS Bill of lading report shows the same misbehavior, so everything explained here is applicable to this report too.

The Bug: Report is always printed to Screen

As shown on the screenshots below, regardless of whether you select File, Printer or Email as the target print destination, each time you start Container contents report it will be printed to Screen.

 

Yes, you are right – this is a bug! By analyzing the X++ code in the report controller class we saw that the print destination selected on the report dialog form is actually ignored when the report is executed, and the print settings from Print management setup for this report are loaded and used instead.

You can find Print management setup for this report here (Warehouse management > Setup > Warehouse management parameters > Print management tab):

If you haven’t change anything so far, <Default> is selected as the target print destination by default.

The <Default> token will be resolved either as Screen or as PDF File, depending on the setup on Legal entities. If we check this setup for our legal entity – USMF, Print destination default is set to Screen.

This explains why Container contents report is always printed to Screen no matter which print destination we select on its report dialog form.

The Workaround: Use Print management setup instead

Let’s change the target print destination to Email in Print management setup, and execute Container contents report once again. Voila! This time the report will be emailed.

The workaround we can use here is to configure Print management setup in advance and then start printing Container contents report by clicking the OK button on its report dialog form, having in mind that those print settings configured in Print management setup will actually be used every time when report is executed.

The Solution: Introduce a new report parameter

The appropriate solution would actually be to introduce a new report parameter Use print management destination, similar to the Customer account statement report.

 

Depending on this parameter’s value, either the print destination settings selected on the report dialog form or those from Print management setup will be used when the report is executed.

Learn more about this solution >>

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