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

Sum a Group Header

Status
Not open for further replies.

SimonPetherick

Technical User
Sep 25, 2002
49
AU
Hi,

I have a report that displays data for every ten minutes over a 24 hour period. I have 2 group headers, one which groups it by 'hour' and the other to group it by 'site name'.

I have suppressed the details section and I have hidden the header which groups it by hour so that the user can only view the data by site name but can drill down to see the data by hour if they wish.

I have summed the 'gas flow' which is listed in the details section, into the hourly grouping and also the site name grouping. This enables the user to see 24 hour flow but they can break it down into houly flow as well by double clicking the site name.

I need to highlight the group header 1 (site name) if any of the hourly flows (in group header 2) show zero BUT only between the hours 08:00 to 16:00.

Does anyone know how I can achieve this result?

Cheers,

SP
 
You could accomplish something like this if you were willing to use the group footer instead of the group header. The display before drill down would look the same, but the drilldown would show summaries for hours above the summaries for site.

Create a formula {@nogas}:

If sum({table.gasflow},{hours}) = 0 and
{table.hours} in 08:00 to 16:00 then 1 else 0

Place this in the Group 2 (hours) footer. Then create three formulas:

{@gasreset} to be placed in Group 1(site) header:

whileprintingrecords;
numbervar nogas := 0;

{@gasdetail} to be placed in details section:

whileprintingrecords;
numbervar nogas;

nogas := nogas + {@nogas}

{@displaygas} to be placed in Group 1 (site) footer:

whileprintingrecords;
numbervar nogas;
nogas;

Then go to format section->group 1 footer->color->background color and enter:

if {@displaygas} > 0 then crYellow else crNocolor

-LB
 
Since you are trying to base the condition on a group value within a larger group, typically you can only do this with running totals.

However, there is a way to use a hidden cross-tab in the GH to increment a running total. Requires a pretty sophisticated use of variables. You can read about it in the following article:


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Thanks LB.
Works like a treat.
Thanks also to kenhamady. The article has come to good use.
SP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top