【发布时间】:2012-05-11 05:11:17
【问题描述】:
我使用三个公式在报告的页脚中显示总页数:
@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。有什么想法吗?
【问题讨论】:
-
你的意思是增加它们就好了吗?您用于显示值的公式是什么样的?您所做的很简单——为什么不直接使用运行总计(或汇总字段)?
-
啊,你正在重置每一页。如果您添加与您的页面对应的分组级别 - 它基于某种组,不是吗? – 您可以使用汇总或运行总计,这样会更简洁。
-
没有组,只有每页的总数,所以据我所知,我不能使用运行总数。其他变量似乎没有增加,除了一个变量,它显示得很好。编辑了我的问题以包含显示公式。
标签: crystal-reports cumulative-sum