0

我使用三个公式在报告的页脚中显示总页数:

@InitializeTotals(放置在页眉中)

whileprintingrecords;
global currencyvar totalsssprem:=0;
global currencyvar totalhdmfprem:=0;
global currencyvar totalphilhealth:=0;
global currencyvar totalsalcal:=0;
global currencyvar totalhdmfloan:=0;
global currencyvar totalhousing:=0;
global currencyvar totallending:=0;
global currencyvar totalcashadv:=0;
global currencyvar totaldamages:=0;
global currencyvar totalcashbnd:=0;
global currencyvar totalfines:=0;
global currencyvar totallosttck:=0;
global currencyvar totalothers:=0;
global currencyvar totalasscntr:=0;
global currencyvar totalcndonation:=0;
global currencyvar totalnetpay:=0;

@IncrementTotals(放在详细信息部分)

whileprintingrecords;
global currencyvar totalsssprem;
global currencyvar totalhdmfprem;
global currencyvar totalphilhealth;
global currencyvar totalsalcal;
global currencyvar totalhdmfloan;
global currencyvar totalhousing;
global currencyvar totallending;
global currencyvar totalcashadv;
global currencyvar totaldamages;
global currencyvar totalcashbnd;
global currencyvar totalfines;
global currencyvar totallosttck;
global currencyvar totalothers;
global currencyvar totalasscntr;
global currencyvar totalcndonation;
global currencyvar totalnetpay;
totalsssprem:= totalsssprem + {deposit_summary.sss_prem};
totalhdmfprem:= totalhdmfprem + {deposit_summary.hdmf_prem};
totalphilhealth:= totalphilhealth + {deposit_summary.philhealth};
totalsalcal:= totalsalcal + {deposit_summary.sal_cal};
totalhdmfloan:= totalhdmfloan + {deposit_summary.hdmf_loan};
totalhousing:= totalhousing + {deposit_summary.housing};
totallending:= totallending + {deposit_summary.lending};
totalcashadv:= totalcashadv + {deposit_summary.cash_adv};
totaldamages:= totaldamages + {deposit_summary.damages};
totalcashbnd:= totalcashbnd + {deposit_summary.cash_bnd};
totalfines:= totalfines + {deposit_summary.fines};
totallosttck:= totallosttck + {deposit_summary.lost_tck};
totalothers:= totalothers + {deposit_summary.others};
totalasscntr:= totalasscntr + {deposit_summary.ass_cntr};
totalcndonation:= totalcndonation + {deposit_summary.cndonation};
totalnetpay:=totalnetpay + {@net_pay};

以及页脚中每个变量的显示公式。它们看起来都是这样的:

whileprintingrecords;
global currencyvar totalsssprem;
totalsssprem

这将显示第一个变量 (totalssprem) 的正确总数,但其余的在页脚中显示为 0.00。有任何想法吗?

4

1 回答 1

2

首先想到的是您的一个(或多个)字段可能为空,这会导致公式出错。在你的增量公式中尝试这样的行,看看它是否有帮助:

if not(isnull({deposit_summary.sss_prem})) then totalsssprem:=totalsssprem+{deposit_summary.sss_prem};

于 2012-05-11T14:48:20.247 回答