Skip to Content
0
Former Member
Jan 15, 2009 at 09:52 AM

formula gets reset on the next page.

179 Views

Morning all,

I have used a formula under Crosstab (Display String) for my DistinctCount field. The D.String, has a formula which displays values of the currentfield as cumulative, however this value is being reset when the next page is loaded.

For example

1st Page

30%

60%

80%

2nd Page

0.1%

0.2%

1.0%

The formula is

Whileprintingrecords;

Numbervar x:=Currentfieldvalue;
Numbervar c:={@TotalJobs-CancelledJobs};
Numbervar v:=((x/c)*100);

Numbervar gTot:=gTot+v;

if gTot > 100 then "100.00%"
else 
totext(gTot,2)+"%"

gTot is being set to reset on Report Header like this

Whileprintingrecords;
Global Numbervar gTot:=0;

Now if I take that reset out, it does not make any difference to the display string value, it still resets it when it gets to next page.

It works fine as long as the values stay under first page.

Where and what am I doing wrong?

P.S. The distinct Count is a formula field like this

Whileprintingrecords;

if {order_header.order_status}<>0 and {order_header.order_status}<>-1 then
{order_header.order_no}
else
tonumber({@null})

The above formula is then being used under Crosstab for DistinctCount.

Regards

Jehanzeb