cheerfulskeptic
Programmer
Hi,
I have a simple report - Group A, Group B (which contains a subreport). I am trying to get a running total of records inside each subreport and print it out at th end.
I declare a shared variable, say VarA and set it to 0 at the report header.
Then inside the subreport, I say VarA = VarA + {@total}.
Then I printit out at the end.
Hwoever, whenever it reaches a zero value inside the subreport, it tanks. I've even put a clause that says if @total > 0 then VarA = VarA + {@total} but it doesnt return the correct values (ie, it sorta resets the shared variable back to a different number.)
here are my formulas:
Report Header:
whileprintingrecords;
shared numbervar numCatsLY := 0;
Inside Footer of Subreport:
whileprintingrecords;
if {@TotLY} > 0 then
shared numbervar numCatsLY := shared numbervar numCatsLY + {@TotLY} ;
at Report Footer (final value to be displayed)
whileprintingrecords;
shared numbervar numCatsLY ;
numCatsLY
What seems to be the problem?
Thanks in advance!
I have a simple report - Group A, Group B (which contains a subreport). I am trying to get a running total of records inside each subreport and print it out at th end.
I declare a shared variable, say VarA and set it to 0 at the report header.
Then inside the subreport, I say VarA = VarA + {@total}.
Then I printit out at the end.
Hwoever, whenever it reaches a zero value inside the subreport, it tanks. I've even put a clause that says if @total > 0 then VarA = VarA + {@total} but it doesnt return the correct values (ie, it sorta resets the shared variable back to a different number.)
here are my formulas:
Report Header:
whileprintingrecords;
shared numbervar numCatsLY := 0;
Inside Footer of Subreport:
whileprintingrecords;
if {@TotLY} > 0 then
shared numbervar numCatsLY := shared numbervar numCatsLY + {@TotLY} ;
at Report Footer (final value to be displayed)
whileprintingrecords;
shared numbervar numCatsLY ;
numCatsLY
What seems to be the problem?
Thanks in advance!