Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sub Total for Each Page Post Reply Post New Topic
Author Message
Lydia
Newbie
Newbie
Avatar

Joined: 21 May 2008
Location: Indonesia
Online Status: Offline
Posts: 2
Quote Lydia Replybullet Topic: Sub Total for Each Page
    Posted: 21 May 2008 at 6:41pm
Hello everybody!  I am a new member of this forum.  I would like to introduce myself by posting a question.  I am not very good in using CR, therefore I am very glad to find this forum where I can learn more from all of you who are experts!

I am making a Sales Report that would present the whole month sales results and it would have a few pages.  My boss would like to have a sales value sub total printed at the bottom of EACH page which is the total sales value for THAT PAGE ONLY.  As far as I know, if I put the running total field on the page footer, than it would contain the sub total for the accumulated running of all the previous records, not for that particular page only.  Somebody told me that I have to create a specific formula to do that, but he does not know how to do it either. 

Would anyone please help me out?

Thanks,
Lydia
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 22 May 2008 at 5:39am
In order to do this kind of operation, put a formula in your Details section that looks like:

WhilePrintingRecords;

Global NumberVar PgTotal;

PgTotal = PgTotal + {MyReport.SalesValue};


In the Page Footer section, put this formula:

WhilePrintingRecords;

Global NumberVar PgTotal;

PgTotal;


In the Page Header section, put this formula:

WhilePrintingRecords;

Global NumberVar PgTotal;

PgTotal = 0;



Here's what this trio of formulas does:
At the top of every page (including the first page, conveniently), the running total is set to 0.  With each record, that record's value is added to the total, summing up the values.  At the bottom of the page, the current value is displayed.


IP IP Logged
Lydia
Newbie
Newbie
Avatar

Joined: 21 May 2008
Location: Indonesia
Online Status: Offline
Posts: 2
Quote Lydia Replybullet Posted: 26 May 2008 at 6:27pm
Thanks a lot, Lugh!
I am sorry I just opened the forum again.  I will give it a try.

Lydia.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.