1

有人知道如何在 FastReport 中设计报告,以便当用户更改页面方向时,所有列标题和数据都会自动调整新的页面宽度?我在那里找不到任何锚机制。也许我可以在运行时做到这一点?但是我需要以某种方式捕捉页面方向更改事件。有人可以帮忙吗?

4

4 回答 4

3

我不知道问题是什么:默认情况下,条带对页面边框具有磁性,因此它们适合新的页面宽度。

但是如果您希望 frxMemoview 对象根据新的页面大小移动和调整大小,您应该使用报表的 beforeprint 事件来重新计算和移动或调整报表组件的大小。

如果您有一份可以纵向或横向打印的报告,最简单的构建方法是纵向布局和横向布局。您可以在加载报告之前显示一个printersetupdailog,并根据方向加载纵向或横向布局。

这可能不是最干净的方式。在代码中构建报表运行时是另一种选择,而重新计算报表中的每个组件则是另一种选择。但是它们涉及大量编码,如果用户选择“Letter”而不是“A4”怎么办?

此致,荷兰的 Teo FR 经销商。

于 2009-12-29T12:57:09.620 回答
0

你可以 :

  • 使用每个 TfrxMemoview 的 Align 属性...
  • 用脚本制作
于 2009-12-29T12:40:32.293 回答
0

有时需要从代码修改报告页面设置(例如,修改纸张对齐或大小)。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» 属性。

下面的例子展示了,如何修改第一页的参数(假设我们已经有一个报表):

帕斯卡:

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;
于 2010-05-19T20:20:59.923 回答
0

BeginDoci 上,您可以使用它访问属性(frxPrincipal.FindObject('Page1') as TfrxReportPage).PaperSize := DMPAPER_A4;

于 2017-06-21T17:56:46.557 回答