• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1535
  • Last Modified:

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

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
dayasd
Asked:
dayasd
  • 2
1 Solution
 
mlmccCommented:
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
 
frodomanCommented:
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
 
frodomanCommented:
Never mind - I just tested and the running total won't let you use printtime values like PageNumber.
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now