Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset by PageNumber 2

Status
Not open for further replies.

alectek

Programmer
Jul 9, 2003
68
US
Hi!
I'm using CR10, SQL Server2000.
I'm trying Reset Running Total by PageNumber to find maximum value of the field on every page.
Not working... :-(
May I get any help?

Thanks.
Alik.


Thanks.
Alec.
 
Generally people won't use non data for resetting values.

Place this in your page header:

whileprintingrecords;
booleanvar NewPage := false

Place this in your page footer:

whileprintingrecords;
booleanvar NewPage := True

In the Evaluate Use a Formula in your Running Total place:

whileprintingrecords;
booleanvar NewPage

Put the running total in a page footer section after the above formula.

-k
 
Thanks Synapsevampire!
As always brilliant idea.
What do I do in "Reset" section of Running Total?
So far I have "Never" and the Running Total is blank...

Thanks.
Alik


Thanks.
Alec.
 
Thanks Synapsevampire!
As always brilliant idea.
What do I do in "Reset" section of Running Total?
So far I have "Never" and the Running Total is blank...


Thanks.
Alec.
 
I tried both ways...Still blank...


Thanks.
Alec.
 
Sorry, I should have tested.

Just leave the page footer formula and then use this as your counting formula:

whileprintingrecords;
booleanvar NewPage;
numbervar MyCount;
If NewPage = True then
(
NewPage:=False;
MyCount:=1;
)
else
MyCount:=MyCount+1

Adjust for whatever type of summary you're using.

-k
 
I would approach this by creating three formulas:

//{@reset} to be placed in the page header:
whileprintingrecords;
numbervar max := 0;

//{@accum} to be placed in the details section:
whileprintingrecords;
numbervar max;

if onfirstrecord or
{table.amt} > max then
max := {table.amt};

//{@display}:
whileprintingrecords;
numbervar max;

-LB
 
Thanks a lot!
It’s working perfect!!!


Thanks.
Alec.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top