Solved

# sum of particular filed in each page footer(pagewise)  and sum of individual page total in last page

Posted on 2007-10-18
1,416 Views
Last Modified: 2008-01-09
I am using asp.net 2005 and I am using crystal reports of asp.net 2005.i want sum of particular filed in every page and its must not add the any filed in previous page

I will explain my in details.

Actual data

Page number                        Page 1      Page 2        Page 3      Page 4
Filed inserted in details           500      200                100           800
200         400                   300      700
800         600                   200      100

As per running total

Page number                         Page 1       Page 2       Page 3           Page 4
Filed inserted in details            500          1700      2800         4100
200             2100         3100            4800
800             2700         3300            4900
Page footer                              1500             2700         3300            4900

What I need

Page number      Page 1      Page 2      Page 3      Page 4
Details                        500           200      100      800
200      400         300         700
800      600         200         100
Page Footer          1500      1200      600      1600

and in last page i must get the total of each page i.e in last page i must get following result

1500      1200      600      1600

0
Question by:dayasd
4 Comments

LVL 100

Accepted Solution

Do you need the overall total at any point?

Try this idea.
Add formulas to the report

In the report header
Name - DeclVars
WhilePrintingRecords;
Global NumberVar PageTotal := 0;
Global StringVar TotalsList := "";
''

In the page header
Name - ResetTotal
WhilePrintingRecords;
Global NumberVar PageTotal;
PageTotal := 0;
''

In the detail section
Name - CalcTotal
WhilePrintingRecords;
Global NumberVar PageTotal;
PageTotal := PageTotal + {YourValueField};
''

In the page footer
Name - BuildTotalList
WhilePrintingRecords;
Global NumberVar PageTotal;
Global StringVar TotalsList;
TotalsList := TotalsList & ToText(PageTotal,0,'') & "     ";
PageTotal

In the report footer
Name - DispTotalList
WhilePrintingRecords;
Global StringVar TotalsList;
TotalsList

mlmcc
0

LVL 42

Expert Comment

Couldn't you simply reset the running total on every page with a formula like this:

shared numberVar LastPage;
booleanVar Result := (LastPage <> PageNumber);
LastPage := PageNumber;
Result;

0

LVL 42

Expert Comment

Never mind - I just tested and the running total won't let you use printtime values like PageNumber.
0

LVL 1

Expert Comment

Forced accept.

Computer101
EE Admin
0

## Join & Write a Comment Already a member? Login.

For a variety of reasons, it sometimes makes sense to reboot a Windows-based computer on a regular, perhaps daily basis. This "cures" a lot of ills by resetting processes, flushing caches, refreshing memory, and reestablish network connections. In a…
The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

#### 728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!