How to control printer orientation(Landscape / Portrait) for an AX report in X++

You should try this:

1. Set property Orientation on your report design to Auto

2. In your fetch method on report add following code (you can add some conditions to determine proper orientation )

element.printJobSettings().preferredOrientation(PrinterOrientation::Portrait);

element.printJobSettings().fitToPage(false);

Flag Counter
原文地址:https://www.cnblogs.com/sunsoftware/p/How-to-control-printer-orientation.html