Search code examples
delphireporting-servicesevent-handlingorientationfastreport

FastReport page orientation change in Delphi


Does anybody know how to design report in FastReport so that when user changes page orientation all column headers and data autofits new page width? I couldn't find any anchor mechanism there. Maybe I can do that during run-time? But then I need to catch page orientation change event somehow. Can anybody help?


Solution

  • I don't know what the question is: Bands are magnetic to page borders by default, so they fit the new page width.

    But if you want the frxMemoview objects to move and resize according to the new page size, you should use the beforeprint event of the report to recalculate and move or size the report components.

    If you have a report that can be printed both in portrait or landscape, the easiest way to buid this would be a layout for portrait and one for landscape. You could show a printersetupdailog before loading the report and depending on the orientation load the portrait or landscape layout.

    This may not be the cleanest way. Building your report runtime in code is another option and recalculating every component in the report is another. But they involve a lot of coding and what if the user selects "Letter" instead of "A4"?

    Regards, Teo FR dealer in Holland.