How to save and restore paper orientation (LANDSCAPE) for PRINTER built-in variable?

How can I read and write the LANDSCAPE property of built-in PRINTER variable?

Hi @RichCPT

Landscape mode is a property of the report.


You can set it to values of ‘1’ or ‘’ (empty string)

  Report{PROP:LANDSCAPE} = '1'   !Turn LANDSCAPE on
  Report{PROP:LANDSCAPE} = ''    !Turn LANDSCAPE off

Replace Report with your report name.

It’s not something I have had to do, and I am not sure (haven’t checked) what happens to the widths of your various bands.

I hope this helps


Been a while since I’ve done reports, but I don’t remember anything being automatic regarding the band widths when changing the orientation.

Because there’s nothing automatic. If you change the orientation at runtime you need to alter the band widths and the location of the header and footer to account for the change.

You can mix orientation in a report as it’s being processed although previewing will be a bit off since it’s related to the orientation of the original report.

You can also mix paper sizes and paper source as long as the report is being processed on one printer.

ENDPAGE() is your friend! It does a ResetDC in the background which supports changes like this.

1 Like

Thanks for the tips. I think I have everything I need to solve the problem. I will explain later after I am sure it is working.