@1本页合 计:------------------------------------------------------------------------------ 一:使用sum函数在reportsummary,或pagefooter,或masterfooter中; 二:使用代码: procedure Tfrm_RepairRecordC.frReport1GetValue(const ParName: String; var ParValue: Variant);begin if ParName='text1' then begin ParValue:=clientdataset1.fieldbyname('RepairPrice').Value; //showmessage(ParValue); end;end; 再在fastreport中的pagefooter中: 加入一个memo为:本页总记录数为:¥[SUM([text1])]@2:本期合计:------------------------------------------------------------------------ 本页合计是针对当前页的合计,本期合计是指这次报表的合计 本期合计,麻烦点,得用script,放个页脚Band,保镖设置中选“两遍报表” 在page1的OnBeforePrint: if not FinalPass then hj1 := 0; 在MasterData1的OnBeforePrint: if not FinalPass then hj1 := hj1 + [Table1."Jbgz"]; 这样hj1就是本期合计数。再在pagefooter中放一个memo:他的text中为[hj1];
各位帮忙解决一下
利用fastreport,在报表的最后一行显示上面所有记录字段的和,
报表:a b c
1 2 3
3 4 5
5 7 7
合计:9 13 15
请大家给个建议把
:::
[sum([cds."a"])] [sum([cds."b"])] [sum([cds."c"])]
//-----------------------------------------------------
看看自带的例子
一:使用sum函数在reportsummary,或pagefooter,或masterfooter中;
二:使用代码:
procedure Tfrm_RepairRecordC.frReport1GetValue(const ParName: String;
var ParValue: Variant);begin
if ParName='text1' then
begin
ParValue:=clientdataset1.fieldbyname('RepairPrice').Value;
//showmessage(ParValue);
end;end;
再在fastreport中的pagefooter中:
加入一个memo为:本页总记录数为:¥[SUM([text1])]@2:本期合计:------------------------------------------------------------------------
本页合计是针对当前页的合计,本期合计是指这次报表的合计
本期合计,麻烦点,得用script,放个页脚Band,保镖设置中选“两遍报表”
在page1的OnBeforePrint:
if not FinalPass then
hj1 := 0;
在MasterData1的OnBeforePrint:
if not FinalPass then
hj1 := hj1 + [Table1."Jbgz"];
这样hj1就是本期合计数。再在pagefooter中放一个memo:他的text中为[hj1];