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

OnLastRecord in Group Header

Status
Not open for further replies.

hpl2001

Programmer
Dec 18, 2001
105
CA
Hi:

I have a report where OnLastHeader is used for suppression of some sections. I am finding that it evaluates correctly in the Group Footer, but not in the Group Header. I can't move the header information into the footer, because I need to display another section in between. I want to display my last record. What I want to display is
GH3
GF5
GF5
GF5
GF3

But all I get if the GF3. Does anyone know how I can test for last record on the section before GF3, and get the correct result?

TIA

Holly
 
Where's GH/GF4?

I suggest posting example data and expected output as opposed to descriptions of the need.

In general add the always include the version of Crystal.

One way you might accomplish group counting is to use a distinctcount({table.groupfield}), and then use the 3 formula method to count and compare which group you're in, as in:

Reportheader:
numbervar GH3count:=distinctcount({table.g3field})

GH3 header:
whileprintingrecords;
CurrCounter:=1

GH3 footer formula:
whileprintingrecords;
CurrCounter:=CurrCounter+1

Now you can test anywher whether the GH3Count-1 = CurrCounter

If this isn';t what you need, or you need clarification, state specifically where you are intending to test for the count of what group.

"But all I get if the GF3." doesn't describe where.

-k
 
OnLastRecord is only true if you are on the last RECORD. If your group has more than one record then it will not be true if you are on the last group.

If you are trying to identify the last group use
GroupNumber = DistinctCount({table.groupfield}).

If your group isn't the top level you may need to include the higher level group fields in the DistinctCount

Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top