Monday, December 20, 2010

Suppress the scaling message on AX Reports

While working on AX reports, I got a very powerful and useful feature of AX. When a report doesn't fit on a page, depending on its properties Ax will resize the report.


Now AX will inform you that the report has been rescaled (Report is scaled xx percent to fit to page) and this message is generally not well received by users.
Users are annoyed by the message, they get it every time they run the report, they cannot do anything about it, and they have to click to close the infolog.

In order to get rid of this message on a particular report you can just modify the init() method of that report and add this line of code.
this.printJobSettings().suppressScalingMessage(true);
How about to cut the roots of this message and just change on one place then you can get rid of this message on all the reports rather than to go on each report and modify its init() method.
Go to class SysReportRun, in the Run method, place following code before the call to super:
if(this.printJobSettings())
this.printJobSettings().suppressScalingMessage(true);
Now we don't have to modify each and every report and our users are happy.

Note that you can still override the settings in your report. In some reports this is done by default, like SalesInvoice and SalesConfirm.