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