报表控件FastReport VCL如何改报告页面的属性

FastReport VCL是用于Delphi,C ++ Builder,RAD Studio和Lazarus的报告和文档创建VCL库。它提供了可视化模板设计器,可以访问为30多种格式,并可以部署到云,网站,电子邮件和打印中。

近日,FastReport VCL更新至v6.9,在新版本中,在PDF更新中增加了对以下对象的并行表单支持:文本,替换和图片。能够通过InteractiveForms字体子集属性将所需的字形仅包含在相互之间形式中。同时修复了多个Bug问题。欢迎下载体验。(旁边向下按钮下载)

【慧都网】下载FastReport VCL v6.9最新版

有时有必要从代码中修改报告页面设置(例如,修改纸张对齐方式或尺寸)。本TfrxReportPage类包含以下属性,定义页面的大小:

    property Orientation: TPrinterOrientation default poPortrait;
    property PaperWidth: Extended;
    property PaperHeight: Extended;
    property PaperSize: Integer;

该PaperSize属性设置纸张格式。这是Windows.pas中定义的标准值之一(例如DMPAPER_A4)。如果为此属性分配了一个值,则FastReport会自动填充PaperWidth和PaperHeight属性(纸张尺寸以毫米为单位)。将DMPAPER_USER(或256)值设置为格式,将意味着已设置自定义纸张尺寸。在这种情况下,PaperWidth和PaperHeight属性应手动填写。
以下示例显示了如何修改第一页的参数(假设我们已经有一个报告):
Pascal:

var
  Page: TfrxReportPage;

{ the first report’s page has [1] index. [0] is the Data page. }
Page := TfrxReportPage(frxReport1.Pages[1]);

{ modify the size }
Page.PaperSize := DMPAPER_A2;

{ modify the paper orientation }
Page.Orientation := poLandscape;

C ++:

TfrxReportPage * Page;

// the first report’s page has [1] index. [0] is the Data page. 
Page = (TfrxReportPage *)frxReport1.Pages[1];

// modify the size 
Page->PaperSize = DMPAPER_A2;

// modify the paper orientation 
Page->Orientation = poLandscape;

 

如果您对FastReport感兴趣,可以在慧都网免费下载最新试用版,欢迎加入FastReport QQ交流群:801349317

posted @ 2021-05-08 17:16  roffey  阅读(144)  评论(0编辑  收藏  举报