Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtotal & grand total of group

Status
Not open for further replies.

ngcn

MIS
Apr 29, 2002
33
MY
Hi guys,

How to show Subtotal for a group where page number >1 and page number is not the last page ? The last page of the group is used to show Grand total.

eg. If there are 3 pages for a PO. Thr first 2 page will show subtotal, & the last page will show the grand total.


I manage to count the subtotal & the grand Total.

Thank u!

best regards,
ngcn
 
Are you saying you want page totals? Example:
Page 1 of group a = 10,000
Page 2 of group a = 13,000
Page 3 of group a = 12,000
Page 4 of group a = 3,500

Group a total = 38,500

please advise Software Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
dgillz,

If page 4 of group a is the last page, then subtotal for the last page will not be shown, Grandtotal is shown instead.

so it should be :
Page 1 of group a : Subtotal-10,000
Page 2 of group a : Subtotal-13,000
Page 3 of group a : Subtotal-12,000
Page 4 of group a : Grandtotal-38,500 - subtotal is being
suppressed

best regards,
ngcn

 
In your group header, insert:

//@F1
whileprintingrecords;
numbervar subtotal := 0;

Details, insert:
//@F2
whileprintingrecords;
numbervar subtotal := subtotal + {field.value};

Page Footer, insert:
//@F3
whileprintingrecords;
numbervar pagecounter := pagecounter + 1;

//@F4
whileprintingrecords;
numbervar subtotal;

Conditionally suppress @F4 with:
{@F3} = 1 or
{X} = maximum({X},{Group A})

X in this case should be a unique non-string field in the details section.


Naith
 
Hi Naith,


I have tried out ur formula @F3 coz I already have the subtotal calculated, and in the Group footer which is where the subtotal situated, I suppress using ur formula as below :
{@F3}=1 or {PODetails.ItemNo} = maximum({PODetails.ItemNo}, {PODetails.PONo})

{x} is being replaced by {PODetails.ItemNo}, it is an unique no field in details section. Whereas, {GroupA} is replaced by {PODetails.PONo} which is the report's group field.

Unfortunately, the result come out the same as mine result before, where subtotal is being suppress no matter what.

Please help me out ! Thank you.

best regards,
ngcn
 
I'm aware that you were having this problem a few days ago ... have you resolved it yet?

I'm not sure that I understand what you mean in the beginning of your post.

If you create the formulas I mentioned, and place them in the areas specified, replacing {X} with {PODetails.ItemNo}, and {PODetails.PONo}, you'll get totals for page 2 until last page -1, according to my tests.

Ensure that your 3rd formula says

whileprintingrecords;
numbervar pagecounter := pagecounter + 1;

as opposed to

numbervar pagecounter := 1;

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top