Pergunta

I'm displaying a page total in the page footer of my report by using three formulas:

@InitializeTotals (placed in the page header)

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 (placed in the details section)

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};

And a display formula for each variable in the page footer. They all look like this:

whileprintingrecords;
global currencyvar totalsssprem;
totalsssprem

This displays the correct total for the first variable (totalsssprem) just fine, but the rest are shown as 0.00 in the page footer. Any ideas?

Foi útil?

Solução

The first thing that comes to mind is that one (or more) of your fields could be null which would cause the formula to crap out. Try lines like these in your increment formula and see if it helps at all:

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top