繁体   English   中英

如何在VCL FastReport中更改页面方向

[英]How to change page orientation in VCL FastReport

我正在使用Embarcadero版本的FastReport,并且需要在运行时更改某些子报表页面的方向(主要是由于图片)。 根据程序员的手册,它应该很容易,但是我不知道如何或何时可行。 我试图更改这两个事件中的所有页面,但没有成功。 我不确定在此版本中它是否可以正常工作,或者我缺少一些东西。

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;

采用

TfrxReportPage(frxReport1.FindObject('Page1')).Orientation := TPrinterOrientation.poLandscape;
frxReport1.ShowReport;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM