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

Posted on 2007-10-18
Last Modified: 2008-01-09
I am using 2005 and I am using crystal reports of 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

Question by:dayasd
    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
    Global NumberVar PageTotal := 0;
    Global StringVar TotalsList := "";

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

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

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

    In the report footer
    Name - DispTotalList
    Global StringVar TotalsList;

    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;

    LVL 42

    Expert Comment

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

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    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.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now