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

Total in Group Header and Report Header? 2

Status
Not open for further replies.

LadyJAG

Programmer
Apr 14, 2004
12
CA
I'm using Crystal xi and a native connection to an Oracle Database.

I have a report with two groups (this is an on demand sub-report)
RH
GH1 - Area
GH2 - GroupType

I have a field in the Details called WellsTiedIn, the value of this field is 1 or 0. They want me to put the sum of this field in the group header for AREA and a total for all of the groups in the Report Header.

Is this possible?
 
Please explain what you did so the thread is of value to others.

-LB
 
For the Report Header I created a formula field
sum({WellsTiedIn})
and for the Area Header I used
sum({WellsTiedIn},{Area})

Works like a charm.
 
Is there a way to do this same thing if you don't have a group to pass into the sum function? So in my report, every 999 detail rows I split into a second page. So I might loop over 1,500 records and get 1,500 detail rows... between 999 and 1000 I have to put a footer and then a header for the next page, and they want the total for each page in the header. So I haven't found a way to group these that allows me to do this nice solution... are there any other ways to accomplish the same thing? Thanks in advance!
 
Create a formula {@cnt}

whilereadingrecords;
numbervar cnt := cnt + 1;

if cnt in 1 to 999 then "000 to 999" else
if cnt >= 1000 then "1000+"

Insert a group on this, and then you can insert summaries at the group level. You can format the report to "new page after" (add "not onlastrecord" in the x+2 area) on the group footer so that the group header becomes the page header for each page.

-LB
 
Hey thanks...this was a great help!

Here is my final solution... since yours only covered one split of pages I needed to modify it a bit to handle any number of page splits...

created formula {@count}:

whilereadingrecords;
global numbervar cnt := cnt + 2;
numbervar output;
if cnt mod 998 = 0 then
(
output := output + 1;
// each page also has one line
// for header and one line for footer so add 2 more
cnt := cnt + 2;
);
output;

I grouped on the above formula and then was able to sum on this:
sum({@_Amount},{@count})

Thanks so much for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top