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

Finding Summary of a field in Group Header

Status
Not open for further replies.

kutoose

Technical User
Sep 11, 2002
169
0
0
US
Crystal Reports 10/ Crystal xi

I have a report in which I need to find the Sum of a field in Group header1 and
Group header 2. This report has three groups –

Region - Group 1
City - Group 2
Invoice No.- Group 3

In Group 3 Header, I am displaying the invoice amount. Now in the detail
section, I am having different 'status' of the invoice and that is a
drill down level. Now I need to display the invoice total at a City level (Group 2)
and Region level ( Group 1 ).

When I do a Insert Summary of Invoice amount it gives incorrect amount...
Say I have invoice amount 100, and there are 3 status for that invoice, it gives
an summary value of 300 in City Group header, which should be only 100 (assuming
there is only one invoice in that City )..

How can I accomplish this ?

I need to put the summary in Group headers and not footers....

Thanks !
 
If the status field is what is causing the duplication of values, you might want to remove that field and instead use a subreport for the invoice status that is placed in the group #3 footer. Use the detail section to add the invoice amount for inserting the summary (which you will drag to the group header) and then suppress the details section or remove the detail field altogether. You might need Database->"Select distinct" checked, not sure.

-LB
 
Humm..

I need the detail section there - since I am already doing summary calculation from the detail section... Is there any formula which can help me ?
 
Please explain more of what you mean. You can do calculations in the detail section without displaying it. You can insert summaries on detail fields and omit the detail fields. I don't think there is a way to get a summary into the header by formula when you have duplicate values without using subreports.
If you remove the status field and your group header inserted summaries are then correct, then the solution is to use a subreport in the group footer to display the detail with the status info, so that the status records don't affect the calculation. If you need the status fields for certain calculations, please explain. You could always use shared variables to display calculations in a group footer section.

Another approach would be to use subreports that contain no duplicate records (no status field) to display the summary in the group header. Then you could still use the status field in the detail section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top