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!

Print grand total immediately after group total.

Status
Not open for further replies.

bigmax98

Programmer
Apr 9, 2002
18
US
Right now my program displayed group total for each group then I force a new page - CHR(12)after section because the output of this program will be displayed on the web server.

How do I print grand total (1 time only) immediately after the last group total.

Thanks,
Trang
tngoe@gmu.edu

 
Put a control that sum's the grand total in the report footer or header. Set its visible property to no (hide it).
Name it something like txtGrand_Total. Also add a hidden control to get the max or min of the value you are grouping by (Max for ascending sort and min for descending). Name it something like txtGroup_Test.

In the Group section with the total, add a new control with a control source something like...

Code:
=IIF(GroupField = txtGroup_Test, txtGrand_total, Null)

That should only show the grand total if it is the last grouping. Null will basically make it invisible and if you combine it with can shrink, allows the section to get smaller.
 
It didn't work for me because Groupfield always = txtGroup_Text (TxtGroup_Text = Max(Orgn), I put it in Group
Header section).

I put a textbox with ctrl source = 1 and running sum = overall in detail section. Then I put a textbox, GroupField, in group footer section below group sum box
with Ctrol Source like this.
=IIf([txtCnt]=Count(*),[txtGrandTotal],Null). It works.
Thank you for giving me some ideas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top