[英]Add space above band in FastReport VCL 5
我有一个正在处理的发票表格,我使用页面标题栏作为主数据(以便在每个页面上显示发票标题信息),然后使用一个主栏来显示发票的行项目,最后显示另一个主表格。带显示总计(总计以多种货币打印)。 我想将第二个主乐队与第一个主乐队分开,但是我看不到这样做的方法。
PAGE HEADER (with invoice header)
MASTER DATA BAND (with invoice detail)
<need space here>
MASTER DATA BAND (with invoice totals)
FOOTER
PAGE FOOTER
更新:这是我的报告中条带的布置方式:
如果我将建议的代码放在MasterData中:Totals OnBeforePrint,那么这就是我所得到的(我用40而不是5来使区别显而易见):
这是没有代码的外观:
这是我的代码:
procedure TotalsOnBeforePrint(Sender: TfrxComponent);
begin
if Engine.FreeSpace > Totals.Height + Footer.Height + PageFooter.Height + 40 then
Engine.CurY := Engine.CurY + 40;
end;
(我在if语句中翻转了符号,否则它将几乎永远不会执行。)
将空白子带添加到masterdata带中。在Child的OnBeforePrint事件中使用:
Child1.Visible:=不是Totals.Dataset.Eof;
如果明细总条带是固定高度,则可以使用条带的OnBeforePrint
(脚本)。 我使用了值5
在进行乐队打印之前将其设置为您想要的任何间距:
procedure MasterDataTotalBandBeforePrint(Sender: TfrxComponent);
begin
// See if there's room for the band between the bottom of the last
// band (MasterDataDetail) and the footer and page footer.
if Engine.FreeSpace > MasterDataTotalBand.Height + FooterBand1.Height +
PageFooter1.Height + 5 then
Engine.CurY := Engine.CurY + 5;
end;
基于@gpi的评论,我在MasterData:MasterData乐队(技术上是TariffRemarks乐队的子乐队)中添加了一个子乐队(名为Spacer)。 然后,我向该子乐队的OnBeforePrint事件添加了以下脚本:
procedure SpacerOnBeforePrint(Sender: TfrxComponent);
begin
Spacer.Visible := MasterData.Dataset.RecNo = MasterData.Dataset.RecordCount - 1;
end;
这可行。 我不确定为什么MasterData.Dataset.eof不起作用,但是我认为在表前进到最后一条记录并将eof标志设置为true之前,会触发最后一条记录的OnBeforePrint事件。 我认为Recno是基于0的,所以MasterData.Dataset.Recno = MasterData.Dataset.Recordcount也将不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.