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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totals by page

Status
Not open for further replies.

staceyn

Technical User
Nov 19, 2004
107
US
Hello,
I am using Crystal pro version 10 with an informix database.
I am trying to get totals on a report by page.

I have created these 3 formulas.
This formula is suppressed and is in the page header.
@reset:
numbervar x;
whileprintingrecords;
x:=0

This formula is suppressed and is in the detail section:
@sum:
numbervar x;
whileprintingrecords;
x:=x+{pickfile.pf_net_qty}

This formula is in the page footer:
@display
numbervar x;
whileprintingrecords;
x

However, it isn't working properly:
There is a grouping by a field called division. It is set to new page before and reset page number after this group prints.
The first page of the report display properly, but it is only about 1/2 a page of data.
The second page of the report is a full page and the count is not accurate.

Any ideas?

Thanks,
Stacey
 
What does the count is not accurate mean?

Try posting technical information instead of trying to describe requirements:

Crystal version
Database/connectivity used
Example data
Expected output

A total isn't very descriptive, if you want the number or sum of some field for each page, and to be reset at each page, please state that.

Your formulas should look like:

@reset:
whileprintingrecords;
numbervar x;
x:=0

This formula is suppressed and is in the detail section:
@sum:
whileprintingrecords;
numbervar x;
x:=x+{pickfile.pf_net_qty}

This formula is in the page footer:
@display
whileprintingrecords;
numbervar x

Now for each page it should display the sum displayed on each page.

And please don't state that it isn't working properly, give examples of the data, the output, and what you want.

-k
 
I am using version 10 crystal pro. Using an informix database.
I do have the formulas stated above in place. However, the detail section is suppressed. We are only showing group totals, page totals, and report totals.

Here is a sample of the output (sample below pages 2 and 3 are full pages of data, pages 1 and 4 are not):

page 1:

division item color qty
A 12345 420 5
A 45678 389 10
A 45126 452 20

page total 35 correct

page 2:

division item color qty
B 12345 420 5
B 45678 389 10
B 45126 452 20
B 12345 420 15
B 12345 420 2
B 12345 420 13
B 12345 420 18
B 12345 420 20
B 12345 420 5

page total 106 should be 108

page 3:

C 12345 420 15
C 45678 389 1
C 45126 452 2
C 12345 420 5
C 12345 420 1
C 12345 420 10
C 12345 420 11
C 12345 420 2
C 12345 420 15

page totals 60 should be 62

page 4:

division item color qty
D 12345 420 5
D 45678 389 10
D 45126 452 20

page totals 35 correct
 
A shame you didn't want to show example data, rather opting to show the summary data.

I'd guess that the difference is that you are showing page totals accurately, yet what you really want is the summary of the summaries on the page, not the summary of the rows which underlay that page within the details.

It's probably not worth explaining what is wrong, so I'll just offer a solution:

Assuming that you are showing the totals for the division group in the group footer, place your summary field that is currently in the details into the group footer section and edit it as follows:

@sum:
whileprintingrecords;
numbervar x;
x:=x+sum({pickfile.pf_net_qty},{pickfile.division})

-k
 
Simple solution. Unsupress the formula in the detail section and see which record(s) is not being counted in the manual running total.
 
How does that resolve anything Mjrbim?

Consider that the summary rows are crossing pages, hence the first page totals are correct, and subsequent pages are less than the total of the summaries.

So I'd guess that what they really want is to summarize the summaries, not the sum of the rows in the details.

-k
 
I have tried what you suggested in changing the variable to x:=x+sum({pickfile.pf_net_qty},{pickfile.division})
and moved the formula to the group footer section. It now prints zero.
Any other possible suggestions?

Thanks,
Stacey
 
You say your data as shown line by line are actually group summaries. What are your groups and what group level are you displaying? I don't think division is the correct level for the group condition.

-LB
 
I think that did it LB
The data was displaying in group 4.
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top