C# - CrystalReports serious prob

EFileTahi-A

Well-known member
Joined
Aug 8, 2004
Messages
539
Location
Portugal / Barreiro
Hi to all...

How can I sum numeric fields per page? That is, the sum will be reset for every page. Yet, how can I then show the sum of all the sums done in every page on the last page?, And making it show some new visual like with some lines textboxes etc..?

Code:
page1:
-------------------------
col1    col2    col3
100     50      10
100     50      20
100     50      10
50      100     10

350     250     50   Total
-------------------------

page2:
-------------------------
col1    col2    col3
100     50      10
100     50      20
100     100     20
100     100     10

400     300     60   Total
-------------------------

page3: (Last page, with modified visual)
-------------------------
col1    col2    col3
100     100     10
50      50      20
100     50      10
50      100     0

*******************
1100    850     140    Total of all pages (including page 3)
*******************

I know how to perform sums... but only for total pages...
 
Last edited by a moderator:
EFileTahi-A you are going to love this one.

I have been trying to do this for ages and finally found a solution.

Dont know if there is another way to do this so if anyone else can suggest something I would also like to know.

What you need to do is create 3 formulas, one to be the running total, one to clear it and one to display it. I got this out of a book I have found.

Running total Formula (This needs to go in your details section, I Suppressed it)

PHP:
WhilePrintingRecords;
CurrencyVar Amount;
Amount := Amount + {Your Field};

Clear total Formula (This needs to go in the page header section, again it is suppressed)

PHP:
WhilePrintingRecords;
CurrencyVar Amount := 0;

Display total Formula (This goes in the page footer)

PHP:
WhilePrintingRecords;
CurrencyVar Amount;

I have the running totals for the report printed in the report footer, the problem with this is that you get a page total and a running total on the last page.

Hopes this helps
 
Back
Top