0

I'm using Embarcadero version of FastReport and I need to change the orientation of some subreport pages at runtime (mostly because of pictures). Based on Programmer's manual it should be easy, but I can't figure out how or when it is possible. I tried to change all pages in these two events, but without success. I'm not sure if it works at all in this version or I'm missing something.

TfrxReport.OnBeforePaint

procedure TForm1.frxReportBeforePrint(Sender: TfrxReportComponent);
begin
  if Assigned(Sender.Page) then
    TfrxReportPage(Sender.Page).Orientation := TPrinterOrientation.poLandscape;
end;

TfrxReport.OnPrintPage

procedure TForm1.frxReportPrintPage(Page: TfrxReportPage; CopyNo: Integer);
begin
  TfrxReportPage(Page).Orientation := TPrinterOrientation.poLandscape;
end;
Triber
  • 1,525
  • 2
  • 21
  • 38

1 Answers1

0

Use

TfrxReportPage(frxReport1.FindObject('Page1')).Orientation := TPrinterOrientation.poLandscape;
frxReport1.ShowReport;
gpi
  • 486
  • 4
  • 8